From 6cf0e518801b271dd7091e616132b6280cb69c9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Wed, 23 Jul 2014 21:57:40 +0200 Subject: [PATCH] User: Normalize skin key from $wgDefaultSkin for default options MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit $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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/User.php b/includes/User.php index ce3ea74839..778e713c7d 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 ) ); -- 2.20.1