From e9dda1ee0ac6cb05e869b0f3e0f6126c3e42b482 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 28 Apr 2016 12:50:52 +0200 Subject: [PATCH] Revert "fixed CS" This reverts commit ba1cd26237adce6757fab28bc0ad7d1b4d776b6b. --- src/Symfony/Component/Routing/Generator/UrlGenerator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Routing/Generator/UrlGenerator.php b/src/Symfony/Component/Routing/Generator/UrlGenerator.php index 2bde7e90d5..db5a68ff53 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -187,15 +187,15 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt if ('' === $url) { $url = '/'; - } elseif (preg_match($this->urlEncodingSkipRegexp, $url)) { - // the context base URL is already encoded (see Symfony\Component\HttpFoundation\Request) + } else if (preg_match($this->urlEncodingSkipRegexp, $url)) { + // the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request) $url = strtr(rawurlencode($url), $this->decodedChars); } // the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3 // so we need to encode them as they are not used for this purpose here // otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route - if (false !== strpos($url, '/.')) { + if(false !== strpos($url, '/.')) { $url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/')); if ('/..' === substr($url, -3)) { $url = substr($url, 0, -2).'%2E%2E';