From a32f2c2087258c8f3f3e58bc95d73efa1c8043c6 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Tue, 17 Mar 2015 01:10:06 -0700 Subject: [PATCH] getMethod should return uppercase string. --- VERSION | 2 +- flight/net/Request.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 963ed7c..c114700 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.10 +1.2.11 diff --git a/flight/net/Request.php b/flight/net/Request.php index e9dac8e..97f2608 100644 --- a/flight/net/Request.php +++ b/flight/net/Request.php @@ -218,14 +218,16 @@ class Request { * @return string */ public static function getMethod() { + $method = self::getVar('REQUEST_METHOD', 'GET'); + if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { - return $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']; + $method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']; } elseif (isset($_REQUEST['_method'])) { - return $_REQUEST['_method']; + $method = $_REQUEST['_method']; } - return self::getVar('REQUEST_METHOD', 'GET'); + return strtoupper($method); } /**