We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit f987273f authored by Brion Vibber's avatar Brion Vibber

Ignore user language settings that aren't listed in language config; we'll...

Ignore user language settings that aren't listed in language config; we'll then fall back to current autodetection. This prevents the surprises where your profile suddenly switches to Arabic because it was selected by default due to lack of a match in the drop-down box.
parent 2fb76eec
......@@ -91,8 +91,16 @@ function common_language()
if (_have_config() && common_logged_in()) {
$user = common_current_user();
$user_language = $user->language;
if ($user_language)
return $user_language;
if ($user->language) {
// Validate -- we don't want to end up with a bogus code
// left over from some old junk.
foreach (common_config('site', 'languages') as $code => $info) {
if ($info['lang'] == $user_language) {
return $user_language;
}
}
}
}
// Otherwise, find the best match for the languages requested by the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment