From: Bartosz DziewoƄski Date: Sun, 10 Aug 2014 01:24:58 +0000 (+0200) Subject: Skin: Don't double-check for non-existing skin in newFromKey() X-Git-Tag: 1.31.0-rc.0~14487^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=b0503fe47a53546f28a63ec0955080a21fe6e39e;p=lhc%2Fweb%2Fwiklou.git Skin: Don't double-check for non-existing skin in newFromKey() normalizeKey() should have already handled this. Change-Id: Idf2510ec86841ed18d589f392a30db1b41ac0c24 --- diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 6ba1efd992..c4de2ad78a 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -148,16 +148,12 @@ abstract class Skin extends ContextSource { */ static function &newFromKey( $key ) { wfDeprecated( __METHOD__, '1.24' ); - global $wgFallbackSkin; $key = Skin::normalizeKey( $key ); $factory = SkinFactory::getDefaultInstance(); - try { - $skin = $factory->makeSkin( $key ); - } catch ( SkinException $e ) { - $skin = $factory->makeSkin( $wgFallbackSkin ); - } + // normalizeKey() guarantees that a skin with this key will exist. + $skin = $factory->makeSkin( $key ); return $skin; }