From 4fcf9efe65a5c329ae09feac560615c70223807e Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 7 Feb 2012 17:52:32 +0100 Subject: [PATCH] [Routing] Small optimization in the UrlMatcher --- src/Symfony/Component/Routing/Matcher/UrlMatcher.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Symfony/Component/Routing/Matcher/UrlMatcher.php b/src/Symfony/Component/Routing/Matcher/UrlMatcher.php index 7029356ece..eaae027392 100644 --- a/src/Symfony/Component/Routing/Matcher/UrlMatcher.php +++ b/src/Symfony/Component/Routing/Matcher/UrlMatcher.php @@ -80,7 +80,7 @@ class UrlMatcher implements UrlMatcherInterface { $this->allow = array(); - if ($ret = $this->matchCollection($pathinfo, $this->routes)) { + if ($ret = $this->matchCollection(urldecode($pathinfo), $this->routes)) { return $ret; } @@ -102,8 +102,6 @@ class UrlMatcher implements UrlMatcherInterface */ protected function matchCollection($pathinfo, RouteCollection $routes) { - $pathinfo = urldecode($pathinfo); - foreach ($routes as $name => $route) { if ($route instanceof RouteCollection) { if (false === strpos($route->getPrefix(), '{') && $route->getPrefix() !== substr($pathinfo, 0, strlen($route->getPrefix()))) {