From 035fd36d3bc1ed3d628790e857d1289ca991902b Mon Sep 17 00:00:00 2001 From: xiaomlove <1939737565@qq.com> Date: Sat, 7 Dec 2024 02:48:03 +0800 Subject: [PATCH] get_user_lang() cancel sqlerr --- include/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index 03d49362..22bbe1bb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -32,8 +32,8 @@ function get_langfolder_cookie($transToLocale = false) function get_user_lang($user_id) { - $lang = mysql_fetch_assoc(sql_query("SELECT site_lang_folder FROM language LEFT JOIN users ON language.id = users.lang WHERE language.site_lang=1 AND users.id= ". sqlesc($user_id) ." LIMIT 1")) or sqlerr(__FILE__, __LINE__); - return $lang['site_lang_folder']; + $lang = mysql_fetch_assoc(sql_query("SELECT site_lang_folder FROM language LEFT JOIN users ON language.id = users.lang WHERE language.site_lang=1 AND users.id= ". sqlesc($user_id) ." LIMIT 1")); + return $lang['site_lang_folder'] ?: 'en'; } function get_langfile_path($script_name ="", $target = false, $lang_folder = "")