Skip to content
Permalink
Browse files

ThinkPHP 5.0.x 远程代码执行高危漏洞 修复

  • Loading branch information...
sugar1569 committed Jul 10, 2019
1 parent ca382cf commit 2cdcd0652edcfeea314099e7da015c254f78bae5
Showing with 8 additions and 2 deletions.
  1. +8 −2 thinkphp/library/think/Request.php
@@ -522,8 +522,14 @@ public function method($method = false)
return $this->server('REQUEST_METHOD') ?: 'GET';
} elseif (!$this->method) {
if (isset($_POST[Config::get('var_method')])) {
$this->method = strtoupper($_POST[Config::get('var_method')]);
$this->{$this->method}($_POST);
$method = strtoupper($_POST[Config::get('var_method')]);
if (in_array($method, ['GET', 'POST', 'DELETE', 'PUT', 'PATCH'])) {
$this->method = $method;
$this->{$this->method}($_POST);
} else {
$this->method = 'POST';
}
unset($_POST[Config::get('var_method')]);
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
$this->method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
} else {

0 comments on commit 2cdcd06

Please sign in to comment.
You can’t perform that action at this time.