ResourcesOOUI: Convert theme names to lowercase
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 23 Jul 2015 17:22:24 +0000 (19:22 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 23 Jul 2015 17:29:37 +0000 (19:29 +0200)
We'd like 'SkinOOUIThemes' to use canonical mixed-case theme names
(see I368804cca141acf9cc15a348d9b7244046395a70), so we must ensure that
lowercase ones are used for file names here before we change the affected
skins (Apex and MonoBook, see I1a88092f0ceb210c642bbee875e368ded3c186f8).

Change-Id: I489922dab303320bfecfbadd26069abbad7d2c53

resources/ResourcesOOUI.php

index 8320b37..974db87 100644 (file)
@@ -27,11 +27,12 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 // WARNING: OOjs-UI is NOT TESTED with older browsers and is likely to break
 // if loaded in browsers that don't support ES5
 return call_user_func( function () {
-       // Core default themes
-       $themes = array( 'default' => 'mediawiki' );
-       $themes += ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
-       $modules = array();
+       $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
+       // We only use the theme names for file names, and they are lowercase
+       $themes = array_map( 'strtolower', $themes );
+       $themes['default'] = 'mediawiki';
 
+       $modules = array();
        $modules['oojs-ui'] = array(
                'scripts' => array(
                        'resources/lib/oojs-ui/oojs-ui.js',