[HttpFoundation] removed extra parenthesis

This commit is contained in:
Fabien Potencier 2013-09-07 14:10:08 +02:00
parent 8e71bfe3b2
commit d05ab6b940
2 changed files with 6 additions and 6 deletions

View File

@ -1628,7 +1628,7 @@ class Request
$seg = $segs[$index]; $seg = $segs[$index];
$baseUrl = '/'.$seg.$baseUrl; $baseUrl = '/'.$seg.$baseUrl;
++$index; ++$index;
} while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos)); } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos);
} }
// Does the baseUrl have anything in common with the request_uri? // Does the baseUrl have anything in common with the request_uri?
@ -1645,7 +1645,7 @@ class Request
} }
$truncatedRequestUri = $requestUri; $truncatedRequestUri = $requestUri;
if (($pos = strpos($requestUri, '?')) !== false) { if (false !== $pos = strpos($requestUri, '?')) {
$truncatedRequestUri = substr($requestUri, 0, $pos); $truncatedRequestUri = substr($requestUri, 0, $pos);
} }
@ -1658,7 +1658,7 @@ class Request
// If using mod_rewrite or ISAPI_Rewrite strip the script filename // If using mod_rewrite or ISAPI_Rewrite strip the script filename
// out of baseUrl. $pos !== 0 makes sure it is not matching a value // out of baseUrl. $pos !== 0 makes sure it is not matching a value
// from PATH_INFO or QUERY_STRING // from PATH_INFO or QUERY_STRING
if ((strlen($requestUri) >= strlen($baseUrl)) && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0))) { if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) {
$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
} }
@ -1711,7 +1711,7 @@ class Request
$requestUri = substr($requestUri, 0, $pos); $requestUri = substr($requestUri, 0, $pos);
} }
if ((null !== $baseUrl) && (false === ($pathInfo = substr($requestUri, strlen($baseUrl))))) { if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
// 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) {

View File

@ -63,8 +63,8 @@ class ServerBag extends ParameterBag
$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];
} }
if ((null !== $authorizationHeader)) { if (null !== $authorizationHeader) {
if ((0 === stripos($authorizationHeader, 'basic'))) { if (0 === stripos($authorizationHeader, 'basic')) {
// Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic
$exploded = explode(':', base64_decode(substr($authorizationHeader, 6))); $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
if (count($exploded) == 2) { if (count($exploded) == 2) {