diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 0d638eda..46ae172c 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1328,8 +1328,8 @@ function get_user_locale(int $uid): string { $sql = "select language.site_lang_folder from useers inner join language on users.lang = language.id where users.id = $uid limit 1"; $result = \Nexus\Database\NexusDB::select($sql); - if (empty($result) || empty($result['site_lang_folder'])) { + if (empty($result) || empty($result[0]['site_lang_folder'])) { return "en"; } - return \App\Http\Middleware\Locale::$languageMaps[$result['site_lang_folder']] ?? 'en'; + return \App\Http\Middleware\Locale::$languageMaps[$result[0]['site_lang_folder']] ?? 'en'; }