bug #15282 [HttpFoundation] Behaviour change in PHP7 for substr (Nicofuma)
This PR was merged into the 2.3 branch.
Discussion
----------
[HttpFoundation] Behaviour change in PHP7 for substr
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
In PHP7 the behaviour of substr() changed.
To resume: "Truncating an entire string should result in a string."
See: https://bugs.php.net/bug.php?id=62922
Commits
-------
ba6000b
[HttpFoundation] Behaviour change in PHP7 for substr
This commit is contained in:
commit
d6af4ad7bf
@ -1790,7 +1790,8 @@ class Request
|
|||||||
$requestUri = substr($requestUri, 0, $pos);
|
$requestUri = substr($requestUri, 0, $pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
|
$pathInfo = substr($requestUri, strlen($baseUrl));
|
||||||
|
if (null !== $baseUrl && (false === $pathInfo || '' === $pathInfo)) {
|
||||||
// If substr() returns false then PATH_INFO is set to an empty string
|
// If substr() returns false then PATH_INFO is set to an empty string
|
||||||
return '/';
|
return '/';
|
||||||
} elseif (null === $baseUrl) {
|
} elseif (null === $baseUrl) {
|
||||||
|
Reference in New Issue
Block a user