@@ -53,9 +53,7 @@ private function addMatcher()
5353
5454 foreach ($ this ->getRoutes ()->all () as $ name => $ route ) {
5555 $ compiledRoute = $ route ->compile ();
56-
5756 $ conditions = array ();
58-
5957 $ hasTrailingSlash = false ;
6058 $ matches = false ;
6159 if (!count ($ compiledRoute ->getVariables ()) && false !== preg_match ('#^(.)\^(?P<url>.*?)\$\1# ' , $ compiledRoute ->getRegex (), $ m )) {
@@ -72,12 +70,10 @@ private function addMatcher()
7270
7371 $ regex = $ compiledRoute ->getRegex ();
7472 if ($ pos = strpos ($ regex , '/$ ' )) {
75- $ regex = substr ($ regex , 0 , $ pos ) . '/?$ ' . substr ($ regex , $ pos +2 );
76- $ conditions [] = sprintf ("preg_match('%s', \$pathinfo, \$matches) " , $ regex );
73+ $ regex = substr ($ regex , 0 , $ pos ).'/?$ ' .substr ($ regex , $ pos + 2 );
7774 $ hasTrailingSlash = true ;
78- } else {
79- $ conditions [] = sprintf ("preg_match('%s', \$pathinfo, \$matches) " , $ regex );
8075 }
76+ $ conditions [] = sprintf ("preg_match('%s', \$pathinfo, \$matches) " , $ regex );
8177
8278 $ matches = true ;
8379 }
@@ -107,7 +103,7 @@ private function addMatcher()
107103 return array('_controller' => 'Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController::urlRedirectAction', 'url' => \$this->context['base_url']. \$pathinfo.'/', 'permanent' => true, '_route' => '%s');
108104 }
109105EOF
110- , $ name );
106+ , $ name );
111107 }
112108
113109 // optimize parameters array
0 commit comments