From 988c95b7ba21138ecab30f600bf2ec9050f49a5e Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 14 Dec 2023 18:19:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=AD=E8=A8=80=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=9C=AA=E5=8C=B9=E9=85=8D=E6=97=B6=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Lang.php b/library/think/Lang.php index 23887a2c..9e6adb3f 100644 --- a/library/think/Lang.php +++ b/library/think/Lang.php @@ -201,7 +201,7 @@ class Lang } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { // 自动侦测浏览器语言 preg_match('/^([a-z\d\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches); - $langSet = strtolower($matches[1]); + $langSet = strtolower($matches[1] ?? ''); $acceptLangs = Config::get('header_accept_lang'); if (isset($acceptLangs[$langSet])) {