mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
修复语言检测未匹配时的错误
This commit is contained in:
@@ -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])) {
|
||||
|
||||
Reference in New Issue
Block a user