From 871c7ae9f4a127793b6a5d088c0c047372d9a04e Mon Sep 17 00:00:00 2001 From: Rob Church Date: Sat, 17 Jun 2006 13:04:19 +0000 Subject: [PATCH] Fix more cases of hard-coded skin dir. --- includes/Skin.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index dc14640d1e..6705fae9d1 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -106,19 +106,19 @@ class Skin extends Linker { * @static */ function &newFromKey( $key ) { + global $wgStyleDirectory; + $key = Skin::normalizeKey( $key ); $skinNames = Skin::getSkinNames(); $skinName = $skinNames[$key]; - global $IP; - # Grab the skin class and initialise it. wfSuppressWarnings(); // Preload base classes to work around APC/PHP5 bug - include_once( $IP.'/skins/'.$skinName.'.deps.php' ); + include_once( "{$wgStyleDirectory}/{$skinName}.deps.php" ); wfRestoreWarnings(); - require_once( $IP.'/skins/'.$skinName.'.php' ); + require_once( "{$wgStyleDirectory}/{$skinName}.php" ); # Check if we got if not failback to default skin $className = 'Skin'.$skinName; @@ -129,7 +129,7 @@ class Skin extends Linker { # is no longer valid. wfDebug( "Skin class does not exist: $className\n" ); $className = 'SkinStandard'; - require_once( $IP.'/skins/Standard.php' ); + require_once( "{$wgStyleDirectory}/Standard.php" ); } $skin =& new $className; return $skin; -- 2.20.1