Config/Locales

* if your current language becomes invalid select the first viable one instead of defaulting to LOCALE_EN
This commit is contained in:
Sarjuuk
2017-02-23 00:47:25 +01:00
parent 090410cbf8
commit ab8d7caced

View File

@@ -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)