Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/148424

Change subject: Define fallback skin using $wgFallbackSkin instead of 
hardcoding Vector
......................................................................

Define fallback skin using $wgFallbackSkin instead of hardcoding Vector

Also removed misleading comment for $wgDefaultSkin.

Bug: 68332
Change-Id: Ibd7485dfa3123fb9ac3e9dd97cbe7129a0969c65
---
M includes/DefaultSettings.php
M includes/Skin.php
2 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/24/148424/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 4606e9e..37d413b 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -2960,12 +2960,15 @@
 /**
  * Default skin, for new users and anonymous visitors. Registered users may
  * change this to any one of the other available skins in their preferences.
- * This has to be completely lowercase; see the "skins" directory for the list
- * of available skins.
  */
 $wgDefaultSkin = 'vector';
 
 /**
+ * Fallback skin used when the skin defined by $wgDefaultSkin can't be found.
+ */
+$wgFallbackSkin = 'vector';
+
+/**
  * Specify the name of a skin that should not be presented in the list of
  * available skins.  Use for blacklisting a skin which you do not want to
  * remove from the .../skins/ directory
diff --git a/includes/Skin.php b/includes/Skin.php
index f493b7b..6ff3018 100644
--- a/includes/Skin.php
+++ b/includes/Skin.php
@@ -145,13 +145,15 @@
 
        /**
         * Normalize a skin preference value to a form that can be loaded.
-        * If a skin can't be found, it will fall back to the configured
-        * default, or the hardcoded default if that's broken.
+        *
+        * If a skin can't be found, it will fall back to the configured 
default ($wgDefaultSkin), or the
+        * hardcoded default ($wgFallbackSkin) if the default skin is 
unavailable too.
+        *
         * @param string $key 'monobook', 'vector', etc.
         * @return string
         */
        static function normalizeKey( $key ) {
-               global $wgDefaultSkin;
+               global $wgDefaultSkin, $wgFallbackSkin;
 
                $skinNames = Skin::getSkinNames();
 
@@ -159,6 +161,7 @@
                $skinNames = array_change_key_case( $skinNames, CASE_LOWER );
                $key = strtolower( $key );
                $default = strtolower( $wgDefaultSkin );
+               $fallback = strtolower( $wgFallbackSkin );
 
                if ( $key == '' || $key == 'default' ) {
                        // Don't return the default immediately;
@@ -186,7 +189,7 @@
                } elseif ( isset( $skinNames[$default] ) ) {
                        return $default;
                } else {
-                       return 'vector';
+                       return $fallback;
                }
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/148424
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd7485dfa3123fb9ac3e9dd97cbe7129a0969c65
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to