Replace deprecated language codes in user options
authorFomafix <fomafix@googlemail.com>
Mon, 28 Mar 2016 08:22:43 +0000 (08:22 +0000)
committerNikerabbit <niklas.laxstrom@gmail.com>
Thu, 14 Jun 2018 13:32:28 +0000 (13:32 +0000)
This change replaces deprecated language codes in the user options by
the new language codes when loading the user setting from database.

The database entry for the user gets updated with the new language code
when the user saves the preferences.

Bug: T131042
Change-Id: I1dd6fb1f240ce3319b132d0f29f0622fba33e655

includes/user/User.php

index c5fa05a..7ad2742 100644 (file)
@@ -5497,6 +5497,11 @@ class User implements IDBAccessObject, UserIdentity {
                        }
                }
 
+               // Replace deprecated language codes
+               $this->mOptions['language'] = LanguageCode::replaceDeprecatedCodes(
+                       $this->mOptions['language']
+               );
+
                $this->mOptionsLoaded = true;
 
                Hooks::run( 'UserLoadOptions', [ $this, &$this->mOptions ] );