From bd17e3008e899631fdbf9a6044b23af80ad6c366 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 31 May 2016 09:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index e056c551..41af2323 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -420,9 +420,10 @@ class Request $this->method = $method; return; } elseif (!$this->method) { - $mask = $this->param(Config::get('var_method')); - if ($mask) { - $this->method = $mask; + if (isset($_POST[Config::get('var_method')])) { + $this->method = strtoupper($_POST[Config::get('var_method')]); + } elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { + $this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); } else { $this->method = IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']); }