Forráskód Böngészése

[Routing] changed matching to only check for method if it is available in the context

Fabien Potencier 15 éve
szülő
commit
2bc47f13f5
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      src/Symfony/Components/Routing/Matcher/UrlMatcher.php

+ 1 - 1
src/Symfony/Components/Routing/Matcher/UrlMatcher.php

@@ -59,7 +59,7 @@ class UrlMatcher implements UrlMatcherInterface
       $compiledRoute = $route->compile();
 
       // check HTTP method requirement
-      if (!isset($this->context['method']) || (($req = $route->getRequirement('_method')) && !in_array(strtolower($this->context['method']), array_map('strtolower', (array) $req))))
+      if (isset($this->context['method']) && (($req = $route->getRequirement('_method')) && !in_array(strtolower($this->context['method']), array_map('strtolower', (array) $req))))
       {
         continue;
       }