From c4686695bc9ecb550b2cfc0e509665774310038e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 29 Dec 2016 10:18:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BB=E7=9A=84inpu?= =?UTF-8?q?t=E5=92=8Cpost=E6=96=B9=E6=B3=95=E5=AF=B9json=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E6=8E=A5=E6=94=B6?= 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 a806dd87..b8bcb512 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) && strpos($content, '":')) { + if (empty($_POST) && 'json' == $this->type()) { $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 (strpos($content, '":')) { + if ('json' == $this->type()) { $this->put = (array) json_decode($content, true); } else { parse_str($content, $this->put);