diff options
author | Robin Appelman <robin@icewind.nl> | 2019-12-16 15:27:08 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-12-16 15:27:08 +0100 |
commit | db0bb8ae696a3d79f37ef3a13d6f70a7a01b50bf (patch) | |
tree | ee1f99d7ee76eb0c805985a30e2ea358b549938d /apps | |
parent | 97deaf85b9d18cabfc345025ef273da24006c6de (diff) | |
download | nextcloud-server-db0bb8ae696a3d79f37ef3a13d6f70a7a01b50bf.tar.gz nextcloud-server-db0bb8ae696a3d79f37ef3a13d6f70a7a01b50bf.zip |
add a fallback locale for personal settings page
otherwise if the locale is set to an invalid or no longer existing locale
the rendering of the setting page will throw an exception
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/lib/Settings/Personal/PersonalInfo.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/settings/lib/Settings/Personal/PersonalInfo.php b/apps/settings/lib/Settings/Personal/PersonalInfo.php index ee309873969..646ad04b236 100644 --- a/apps/settings/lib/Settings/Personal/PersonalInfo.php +++ b/apps/settings/lib/Settings/Personal/PersonalInfo.php @@ -251,6 +251,13 @@ class PersonalInfo implements ISettings { return 0 === strpos($localeCode['code'], $userLang); }); + if (!$userLocale) { + $userLocale = [ + 'code' => 'en', + 'name' => 'English' + ]; + } + return [ 'activelocaleLang' => $userLocaleString, 'activelocale' => $userLocale, |