瀏覽代碼

[HttpFoundation] simplified code

Fabien Potencier 14 年之前
父節點
當前提交
9b1b9373b8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/Symfony/Component/HttpFoundation/RequestMatcher.php

+ 2 - 2
src/Symfony/Component/HttpFoundation/RequestMatcher.php

@@ -70,7 +70,7 @@ class RequestMatcher implements RequestMatcherInterface
      */
     public function matchMethod($method)
     {
-        $this->methods = array_map('strtolower', is_array($method) ? $method : array($method));
+        $this->methods = array_map('strtoupper', is_array($method) ? $method : array($method));
     }
 
     /**
@@ -89,7 +89,7 @@ class RequestMatcher implements RequestMatcherInterface
      */
     public function matches(Request $request)
     {
-        if (null !== $this->methods && !in_array(strtolower($request->getMethod()), $this->methods)) {
+        if (null !== $this->methods && !in_array($request->getMethod(), $this->methods)) {
             return false;
         }