From b48d81c16482f90b95eba2db8bc78c006e7916ea Mon Sep 17 00:00:00 2001 From: zzpuser Date: Sun, 7 Aug 2016 17:24:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E2=80=9CisMobile=E2=80=9D?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E9=98=B2=E6=AD=A2=E5=9C=A8=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 若HTTP请求中HTTP_ACCEPT参数缺失会导致页面错误,因此首先需要判断一下该参数是否存在 --- library/think/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Request.php b/library/think/Request.php index 4edf5083..d565eeb0 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1228,7 +1228,7 @@ class Request { if (isset($_SERVER['HTTP_VIA']) && stristr($_SERVER['HTTP_VIA'], "wap")) { return true; - } elseif (strpos(strtoupper($_SERVER['HTTP_ACCEPT']), "VND.WAP.WML")) { + } elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos(strtoupper($_SERVER['HTTP_ACCEPT']), "VND.WAP.WML")) { return true; } elseif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) { return true;