Misc/Locale

* coerce malformed locale values from GET to int instead of failing outright
This commit is contained in:
Sarjuuk
2025-03-04 21:23:50 +01:00
parent 6249f2957e
commit 31ad2e4944

View File

@@ -239,7 +239,7 @@ if (!CLI)
User::save(); // save user-variables in session
// hard override locale for this call (should this be here..?)
if (isset($_GET['locale']) && ($loc = Locale::tryFrom($_GET['locale'])))
if (isset($_GET['locale']) && ($loc = Locale::tryFrom((int)$_GET['locale'])))
Lang::load($loc);
else
Lang::load(User::$preferedLoc);