From c3e45a1a69136384d66c410f43c2c17c6e16b940 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 22 Feb 2017 18:21:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index 5a95f756..d583ead0 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -688,7 +688,7 @@ class Request { if (empty($this->post)) { $content = $this->input; - if (empty($_POST) && 'application/json' == $this->contentType()) { + if (empty($_POST) && false !== strpos($this->contentType(), 'application/json')) { $this->post = (array) json_decode($content, true); } else { $this->post = $_POST; @@ -713,7 +713,7 @@ class Request { if (is_null($this->put)) { $content = $this->input; - if ('application/json' == $this->contentType()) { + if (false !== strpos($this->contentType(), 'application/json')) { $this->put = (array) json_decode($content, true); } else { parse_str($content, $this->put);