mirror of
https://github.com/friendica/friendica
synced 2024-11-18 03:03:41 +00:00
Merge pull request #13732 from annando/issue-13731
Issue 13731: Fix error concerning invalid user
This commit is contained in:
commit
47b0302811
1 changed files with 6 additions and 4 deletions
|
@ -568,10 +568,12 @@ class User
|
||||||
public static function getLanguageCode(int $uid): string
|
public static function getLanguageCode(int $uid): string
|
||||||
{
|
{
|
||||||
$owner = self::getOwnerDataById($uid);
|
$owner = self::getOwnerDataById($uid);
|
||||||
|
if (!empty($owner['language'])) {
|
||||||
$language = DI::l10n()->toISO6391($owner['language']);
|
$language = DI::l10n()->toISO6391($owner['language']);
|
||||||
if (in_array($language, array_keys(DI::l10n()->getLanguageCodes()))) {
|
if (in_array($language, array_keys(DI::l10n()->getLanguageCodes()))) {
|
||||||
return $language;
|
return $language;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return DI::l10n()->toISO6391(DI::config()->get('system', 'language'));
|
return DI::l10n()->toISO6391(DI::config()->get('system', 'language'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue