diff --git a/library/think/Request.php b/library/think/Request.php index 93fbb95b7e6746d7ec4cc6bfb6b92c9f38396a4d..c45b978eb585b954ee8c56d1fd2117f1908623d5 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -733,9 +733,9 @@ class Request } foreach ($this->mimeType as $key => $val) { - $array = explode(',', $val); - foreach ($array as $k => $v) { - if (stristr($accept, $v)) { + $array = array_flip(explode(',', $val)); + foreach ($accept as $v) { + if (isset($array[$v])) { return $key; } }