改进Request类

This commit is contained in:
thinkphp
2016-05-31 09:09:24 +08:00
parent 4a974f52a9
commit bd17e3008e

View File

@@ -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']);
}