From e482cbe7e8a7f8554983400fa725e814ca1ee92a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 22 Feb 2017 11:27:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRequest=E7=B1=BBcontentType?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/think/Request.php b/library/think/Request.php index f32637d5..5a95f756 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1357,7 +1357,11 @@ class Request { $contentType = $this->server('CONTENT_TYPE'); if ($contentType) { - list($type) = explode(';', $contentType); + if (strpos($contentType, ';')) { + list($type) = explode(';', $contentType); + } else { + $type = $contentType; + } return trim($type); } return '';