mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 14:57:23 +08:00
Merge pull request #10696 from githubjeka/patch-1
Refactoring yii\web\Request::getMethod
This commit is contained in:
@@ -231,11 +231,17 @@ class Request extends \yii\base\Request
|
|||||||
{
|
{
|
||||||
if (isset($_POST[$this->methodParam])) {
|
if (isset($_POST[$this->methodParam])) {
|
||||||
return strtoupper($_POST[$this->methodParam]);
|
return strtoupper($_POST[$this->methodParam]);
|
||||||
} elseif (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
|
|
||||||
return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
|
|
||||||
} else {
|
|
||||||
return isset($_SERVER['REQUEST_METHOD']) ? strtoupper($_SERVER['REQUEST_METHOD']) : 'GET';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {
|
||||||
|
return strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($_SERVER['REQUEST_METHOD'])) {
|
||||||
|
return strtoupper($_SERVER['REQUEST_METHOD']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'GET';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user