mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 08:02:48 +08:00
改进Request类
This commit is contained in:
@@ -522,8 +522,11 @@ class Request
|
||||
return $this->server('REQUEST_METHOD') ?: 'GET';
|
||||
} elseif (!$this->method) {
|
||||
if (isset($_POST[Config::get('var_method')])) {
|
||||
$this->method = strtoupper($_POST[Config::get('var_method')]);
|
||||
$method = strtoupper($_POST[Config::get('var_method')]);
|
||||
if (in_array($method, ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'])) {
|
||||
$this->method = $method;
|
||||
$this->{$this->method}($_POST);
|
||||
}
|
||||
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
|
||||
$this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user