改进Request类的post和put方法

This commit is contained in:
thinkphp
2016-12-21 18:11:37 +08:00
parent f417aa6662
commit 565222cfea

View File

@@ -691,7 +691,7 @@ class Request
if (empty($this->post)) {
$content = $this->input;
if (empty($_POST) && strpos($content, '":')) {
$this->post = json_decode($content, true);
$this->post = (array) json_decode($content, true);
} else {
$this->post = $_POST;
}
@@ -716,7 +716,7 @@ class Request
if (is_null($this->put)) {
$content = $this->input;
if (strpos($content, '":')) {
$this->put = json_decode($content, true);
$this->put = (array) json_decode($content, true);
} else {
parse_str($content, $this->put);
}