From ab8d7caced30e3a811bb8f4103b604231ea28c3d Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 23 Feb 2017 00:47:25 +0100 Subject: [PATCH] Config/Locales * if your current language becomes invalid select the first viable one instead of defaulting to LOCALE_EN --- includes/user.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/user.class.php b/includes/user.class.php index 1156fab0..2f627585 100644 --- a/includes/user.class.php +++ b/includes/user.class.php @@ -178,9 +178,18 @@ class User } } - // check - if ($loc != LOCALE_EN && !(CFG_LOCALES & (1 << $loc))) - $loc = LOCALE_EN; + // check; pick first viable if failed + if (CFG_LOCALES && !(CFG_LOCALES & (1 << $loc))) + { + foreach (Util::$localeStrings as $idx => $__) + { + if (CFG_LOCALES & (1 << $idx)) + { + $loc = $idx; + break; + } + } + } // set if (self::$id)