From d05ab6b9409e40e5537783e19ed0cf2139eeac96 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 7 Sep 2013 14:10:08 +0200 Subject: [PATCH] [HttpFoundation] removed extra parenthesis --- src/Symfony/Component/HttpFoundation/Request.php | 8 ++++---- src/Symfony/Component/HttpFoundation/ServerBag.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 137f12c8db..00c8ff6ab1 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1628,7 +1628,7 @@ class Request $seg = $segs[$index]; $baseUrl = '/'.$seg.$baseUrl; ++$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? @@ -1645,7 +1645,7 @@ class Request } $truncatedRequestUri = $requestUri; - if (($pos = strpos($requestUri, '?')) !== false) { + if (false !== $pos = strpos($requestUri, '?')) { $truncatedRequestUri = substr($requestUri, 0, $pos); } @@ -1658,7 +1658,7 @@ class Request // If using mod_rewrite or ISAPI_Rewrite strip the script filename // out of baseUrl. $pos !== 0 makes sure it is not matching a value // 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)); } @@ -1711,7 +1711,7 @@ class Request $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 return '/'; } elseif (null === $baseUrl) { diff --git a/src/Symfony/Component/HttpFoundation/ServerBag.php b/src/Symfony/Component/HttpFoundation/ServerBag.php index 29e11eac81..0e611ccd1e 100644 --- a/src/Symfony/Component/HttpFoundation/ServerBag.php +++ b/src/Symfony/Component/HttpFoundation/ServerBag.php @@ -63,8 +63,8 @@ class ServerBag extends ParameterBag $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; } - if ((null !== $authorizationHeader)) { - if ((0 === stripos($authorizationHeader, 'basic'))) { + if (null !== $authorizationHeader) { + if (0 === stripos($authorizationHeader, 'basic')) { // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic $exploded = explode(':', base64_decode(substr($authorizationHeader, 6))); if (count($exploded) == 2) {