X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FSkin.php;h=117e6e262d35bbcb60eeae0238a3b94aacec4b41;hb=b9bd1b9346f8109e383979c1ce4264d3b7cfdd0b;hp=0cc1086c7a8c9e287a1d0a03762b753430bd5535;hpb=9506e3d8121fb1c12b9cc72ca53561c592fdf6cf;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Skin.php b/includes/Skin.php index 0cc1086c7a..117e6e262d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -56,17 +56,19 @@ abstract class Skin extends ContextSource { $skinDir = dir( $wgStyleDirectory ); - # while code from www.php.net - while ( false !== ( $file = $skinDir->read() ) ) { - // Skip non-PHP files, hidden files, and '.dep' includes - $matches = array(); - - if ( preg_match( '/^([^.]*)\.php$/', $file, $matches ) ) { - $aSkin = $matches[1]; - $wgValidSkinNames[strtolower( $aSkin )] = $aSkin; + if ( $skinDir !== false && $skinDir !== null ) { + # while code from www.php.net + while ( false !== ( $file = $skinDir->read() ) ) { + // Skip non-PHP files, hidden files, and '.dep' includes + $matches = array(); + + if ( preg_match( '/^([^.]*)\.php$/', $file, $matches ) ) { + $aSkin = $matches[1]; + $wgValidSkinNames[strtolower( $aSkin )] = $aSkin; + } } + $skinDir->close(); } - $skinDir->close(); $skinsInitialised = true; wfProfileOut( __METHOD__ . '-init' ); } @@ -129,7 +131,6 @@ abstract class Skin extends ContextSource { // in the user preferences. $fallback = array( 0 => $wgDefaultSkin, - 1 => 'nostalgia', 2 => 'cologneblue' ); @@ -1252,7 +1253,7 @@ abstract class Skin extends ContextSource { } global $wgExternalLinkTarget; - if ( $wgExternalLinkTarget) { + if ( $wgExternalLinkTarget ) { $extraAttribs['target'] = $wgExternalLinkTarget; } } else { @@ -1557,6 +1558,7 @@ abstract class Skin extends ContextSource { function __call( $fname, $args ) { $realFunction = array( 'Linker', $fname ); if ( is_callable( $realFunction ) ) { + wfDeprecated( get_class( $this ) . '::' . $fname, '1.21' ); return call_user_func_array( $realFunction, $args ); } else { $className = get_class( $this );