mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-13 03:32:48 +00:00
ThinkPHP 5.0.x 远程代码执行高危漏洞 修复
This commit is contained in:
parent
ca382cfb19
commit
2cdcd0652e
@ -522,8 +522,14 @@ class Request
|
|||||||
return $this->server('REQUEST_METHOD') ?: 'GET';
|
return $this->server('REQUEST_METHOD') ?: 'GET';
|
||||||
} elseif (!$this->method) {
|
} elseif (!$this->method) {
|
||||||
if (isset($_POST[Config::get('var_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);
|
$this->{$this->method}($_POST);
|
||||||
|
} else {
|
||||||
|
$this->method = 'POST';
|
||||||
|
}
|
||||||
|
unset($_POST[Config::get('var_method')]);
|
||||||
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
|
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
|
||||||
$this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
|
$this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user