Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
icewind1991 committed Dec 16, 2019
commit db0bb8ae696a3d79f37ef3a13d6f70a7a01b50bf
7 changes: 7 additions & 0 deletions apps/settings/lib/Settings/Personal/PersonalInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ private function getLocales(IUser $user) {
return 0 === strpos($localeCode['code'], $userLang);
});

if (!$userLocale) {
$userLocale = [
'code' => 'en',
'name' => 'English'
];
}

return [
'activelocaleLang' => $userLocaleString,
'activelocale' => $userLocale,
Expand Down