mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Request类contentType方法
This commit is contained in:
@@ -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 '';
|
||||
|
||||
Reference in New Issue
Block a user