Commit abae9b6b authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Allow Moodle language preferences without '_utf8' suffix (bug #932332)



Change-Id: Ia8685b5f7afb102f2e8e41e8639e75b371504200
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent c7d7a773
......@@ -472,7 +472,7 @@ class AuthXmlrpc extends Auth {
// Language
if (!empty($remoteuser->lang)) {
$validlanguages = array_keys(get_languages());
$newlanguage = str_replace('_', '.', strtolower($remoteuser->lang));
$newlanguage = str_replace('_utf8', '', strtolower($remoteuser->lang)) . '.utf8';
if (in_array($newlanguage, $validlanguages)) {
set_account_preference($user->id, 'lang', $newlanguage);
$user->set_account_preference('lang', $newlanguage);
......
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