Skip to content

Commit 6000faf

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fix minor phpdoc mismatches with the code(detected by phan) [Asset] Starting slash should indicate no basePath wanted [Security] Fix phpdoc logout listener Fix minor typo in the main README.md
2 parents 07fc060 + c84ee65 commit 6000faf

File tree

24 files changed

+85
-77
lines changed

24 files changed

+85
-77
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ If you discover a security vulnerability within Symfony, please follow our
4646
About Us
4747
--------
4848

49-
Symfony development is sponsored by [SensioLabs][21], lead by the
49+
Symfony development is sponsored by [SensioLabs][21], led by the
5050
[Symfony Core Team][22] and supported by [Symfony contributors][19].
5151

5252
[1]: https://symfony.com

src/Symfony/Component/Asset/PathPackage.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public function getUrl($path)
5858

5959
$versionedPath = $this->getVersionStrategy()->applyVersion($path);
6060

61-
if ($this->isAbsoluteUrl($versionedPath)) {
61+
// if absolute or begins with /, we're done
62+
if ($this->isAbsoluteUrl($versionedPath) || ($versionedPath && '/' === $versionedPath[0])) {
6263
return $versionedPath;
6364
}
6465

src/Symfony/Component/Asset/Tests/PathPackageTest.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ public function getConfigs()
3535

3636
array('', '', '/foo', '/foo?v1'),
3737

38-
array('/foo', '', '/foo', '/foo/foo?v1'),
39-
array('/foo', '', 'foo', '/foo/foo?v1'),
40-
array('foo', '', 'foo', '/foo/foo?v1'),
41-
array('foo/', '', 'foo', '/foo/foo?v1'),
42-
array('/foo/', '', 'foo', '/foo/foo?v1'),
43-
44-
array('/foo', 'version-%2$s/%1$s', '/foo', '/foo/version-v1/foo'),
45-
array('/foo', 'version-%2$s/%1$s', 'foo', '/foo/version-v1/foo'),
46-
array('/foo', 'version-%2$s/%1$s', 'foo/', '/foo/version-v1/foo/'),
47-
array('/foo', 'version-%2$s/%1$s', '/foo/', '/foo/version-v1/foo/'),
38+
array('/foo', '', '/bar', '/bar?v1'),
39+
array('/foo', '', 'bar', '/foo/bar?v1'),
40+
array('foo', '', 'bar', '/foo/bar?v1'),
41+
array('foo/', '', 'bar', '/foo/bar?v1'),
42+
array('/foo/', '', 'bar', '/foo/bar?v1'),
43+
44+
array('/foo', 'version-%2$s/%1$s', '/bar', '/version-v1/bar'),
45+
array('/foo', 'version-%2$s/%1$s', 'bar', '/foo/version-v1/bar'),
46+
array('/foo', 'version-%2$s/%1$s', 'bar/', '/foo/version-v1/bar/'),
47+
array('/foo', 'version-%2$s/%1$s', '/bar/', '/version-v1/bar/'),
4848
);
4949
}
5050

@@ -61,17 +61,17 @@ public function testGetUrlWithContext($basePathRequest, $basePath, $format, $pat
6161
public function getContextConfigs()
6262
{
6363
return array(
64-
array('', '/foo', '', '/foo', '/foo/foo?v1'),
65-
array('', '/foo', '', 'foo', '/foo/foo?v1'),
66-
array('', 'foo', '', 'foo', '/foo/foo?v1'),
67-
array('', 'foo/', '', 'foo', '/foo/foo?v1'),
68-
array('', '/foo/', '', 'foo', '/foo/foo?v1'),
69-
70-
array('/bar', '/foo', '', '/foo', '/bar/foo/foo?v1'),
71-
array('/bar', '/foo', '', 'foo', '/bar/foo/foo?v1'),
72-
array('/bar', 'foo', '', 'foo', '/bar/foo/foo?v1'),
73-
array('/bar', 'foo/', '', 'foo', '/bar/foo/foo?v1'),
74-
array('/bar', '/foo/', '', 'foo', '/bar/foo/foo?v1'),
64+
array('', '/foo', '', '/baz', '/baz?v1'),
65+
array('', '/foo', '', 'baz', '/foo/baz?v1'),
66+
array('', 'foo', '', 'baz', '/foo/baz?v1'),
67+
array('', 'foo/', '', 'baz', '/foo/baz?v1'),
68+
array('', '/foo/', '', 'baz', '/foo/baz?v1'),
69+
70+
array('/bar', '/foo', '', '/baz', '/baz?v1'),
71+
array('/bar', '/foo', '', 'baz', '/bar/foo/baz?v1'),
72+
array('/bar', 'foo', '', 'baz', '/bar/foo/baz?v1'),
73+
array('/bar', 'foo/', '', 'baz', '/bar/foo/baz?v1'),
74+
array('/bar', '/foo/', '', 'baz', '/bar/foo/baz?v1'),
7575
);
7676
}
7777

src/Symfony/Component/CssSelector/Parser/Reader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function getOffset($string)
9797
/**
9898
* @param string $pattern
9999
*
100-
* @return bool
100+
* @return array|false
101101
*/
102102
public function findPattern($pattern)
103103
{

src/Symfony/Component/CssSelector/XPath/Extension/NodeExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function setFlag($flag, $on)
7272
*/
7373
public function hasFlag($flag)
7474
{
75-
return $this->flags & $flag;
75+
return (bool) ($this->flags & $flag);
7676
}
7777

7878
/**

src/Symfony/Component/ExpressionLanguage/Lexer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function tokenize($expression)
4242
continue;
4343
}
4444

45-
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, null, $cursor)) {
45+
if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, 0, $cursor)) {
4646
// numbers
4747
$number = (float) $match[0]; // floats
4848
if (preg_match('/^[0-9]+$/', $match[0]) && $number <= PHP_INT_MAX) {
@@ -69,19 +69,19 @@ public function tokenize($expression)
6969

7070
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
7171
++$cursor;
72-
} elseif (preg_match('/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As', $expression, $match, null, $cursor)) {
72+
} elseif (preg_match('/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As', $expression, $match, 0, $cursor)) {
7373
// strings
7474
$tokens[] = new Token(Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1)), $cursor + 1);
7575
$cursor += strlen($match[0]);
76-
} elseif (preg_match('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A', $expression, $match, null, $cursor)) {
76+
} elseif (preg_match('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A', $expression, $match, 0, $cursor)) {
7777
// operators
7878
$tokens[] = new Token(Token::OPERATOR_TYPE, $match[0], $cursor + 1);
7979
$cursor += strlen($match[0]);
8080
} elseif (false !== strpos('.,?:', $expression[$cursor])) {
8181
// punctuation
8282
$tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1);
8383
++$cursor;
84-
} elseif (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $expression, $match, null, $cursor)) {
84+
} elseif (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $expression, $match, 0, $cursor)) {
8585
// names
8686
$tokens[] = new Token(Token::NAME_TYPE, $match[0], $cursor + 1);
8787
$cursor += strlen($match[0]);

src/Symfony/Component/ExpressionLanguage/Token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Token
3232
/**
3333
* Constructor.
3434
*
35-
* @param int $type The type of the token
35+
* @param string $type The type of the token (self::*_TYPE)
3636
* @param string $value The token value
3737
* @param int $cursor The cursor position in the source
3838
*/

src/Symfony/Component/HttpFoundation/FileBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function add(array $files = array())
6969
*
7070
* @param array|UploadedFile $file A (multi-dimensional) array of uploaded file information
7171
*
72-
* @return array A (multi-dimensional) array of UploadedFile instances
72+
* @return UploadedFile|UploadedFile[] A (multi-dimensional) array of UploadedFile instances
7373
*/
7474
protected function convertFileInformation($file)
7575
{

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ public function getScheme()
943943
* If your reverse proxy uses a different header name than "X-Forwarded-Port",
944944
* configure it via "setTrustedHeaderName()" with the "client-port" key.
945945
*
946-
* @return string
946+
* @return int|string can be a string if fetched from the server bag
947947
*/
948948
public function getPort()
949949
{

src/Symfony/Component/HttpKernel/Bundle/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function getPath()
141141
/**
142142
* Returns the bundle parent name.
143143
*
144-
* @return string The Bundle parent name it overrides or null if no parent
144+
* @return string|null The Bundle parent name it overrides or null if no parent
145145
*/
146146
public function getParent()
147147
{

0 commit comments

Comments
 (0)