User: Normalize skin key from $wgDefaultSkin for default options
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 23 Jul 2014 19:57:40 +0000 (21:57 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 23 Jul 2014 19:57:40 +0000 (21:57 +0200)
$wgDefaultSkin is allowed not to actually be a valid key (although
doing that is obviously very unwise), which in turn can cause
exceptions from Preferences::loadPreferenceValues()
(MWException "Global default…"), which in turn causes failure of
SpecialPreferencesTest::testBug41337() test.

Change-Id: I8f8ae9ba301337b2e6facd3dcfadbf2ab12ac605

includes/User.php

index ce3ea74..778e713 100644 (file)
@@ -1385,7 +1385,7 @@ class User implements IDBAccessObject {
                foreach ( SearchEngine::searchableNamespaces() as $nsnum => $nsname ) {
                        $defOpt['searchNs' . $nsnum] = !empty( $wgNamespacesToBeSearchedDefault[$nsnum] );
                }
-               $defOpt['skin'] = $wgDefaultSkin;
+               $defOpt['skin'] = Skin::normalizeKey( $wgDefaultSkin );
 
                wfRunHooks( 'UserGetDefaultOptions', array( &$defOpt ) );