mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
改进Request类contentType方法
This commit is contained in:
@@ -1357,7 +1357,11 @@ class Request
|
|||||||
{
|
{
|
||||||
$contentType = $this->server('CONTENT_TYPE');
|
$contentType = $this->server('CONTENT_TYPE');
|
||||||
if ($contentType) {
|
if ($contentType) {
|
||||||
list($type) = explode(';', $contentType);
|
if (strpos($contentType, ';')) {
|
||||||
|
list($type) = explode(';', $contentType);
|
||||||
|
} else {
|
||||||
|
$type = $contentType;
|
||||||
|
}
|
||||||
return trim($type);
|
return trim($type);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user