From fbff31b792549b2e23a12c11f39ac886b7dc5cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=A4=A9?= <504750975@qq.com> Date: Fri, 14 Mar 2025 23:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF,=E8=AF=A5=E9=94=99=E8=AF=AF=E6=98=AF=E7=94=B1PHP8.X?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=BC=95=E8=B5=B7=E7=9A=84.=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=20=E7=9A=84=20=E5=9C=BA=E6=99=AF:=E5=BD=93?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=9B=B8=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=97=B6=E6=9C=AA=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0accept,=E5=B9=B6=E4=B8=94=E6=AD=A4=E6=97=B6?= =?UTF-8?q?=E5=BC=80=E7=9D=80Trace=E8=B0=83=20=E8=AF=95=E4=BE=BF=E4=BC=9A?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E6=AD=A4BUG.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/debug/Html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/debug/Html.php b/library/think/debug/Html.php index b6be7adb..c4a5c863 100644 --- a/library/think/debug/Html.php +++ b/library/think/debug/Html.php @@ -47,9 +47,9 @@ class Html $request = Request::instance(); $contentType = $response->getHeader('Content-Type'); $accept = $request->header('accept'); - if (strpos($accept, 'application/json') === 0 || $request->isAjax()) { + if ((is_string($accept) && strpos($accept, 'application/json') === 0) || $request->isAjax()) { return false; - } elseif (!empty($contentType) && strpos($contentType, 'html') === false) { + } elseif (!empty($contentType) && (is_string($contentType) && strpos($contentType, 'html') === false)) { return false; } // 获取基本信息 -- Gitee