Ugly fix for skins that dont extends Skin:specialPagesList such as Nostalgia. Pointed...
[lhc/web/wiklou.git] / includes / Skin.php
index 5fb9a13..1b35625 100644 (file)
@@ -1,18 +1,17 @@
 <?php
+# See skin.doc
 
-require_once( 'Feed.php' );
+require_once( 'Feed.php' );  // should not be called if the actual page isn't feed enabled
 require_once( 'Image.php' );
 
-# See skin.doc
-
 # These are the INTERNAL names, which get mapped
 # directly to class names.  For display purposes, the
 # Language class has internationalized names
 #
 /* private */ $wgValidSkinNames = array(
-       'standard' => 'Standard',
-       'nostalgia' => 'Nostalgia',
-       'cologneblue' => 'CologneBlue'
+       'standard'              => 'Standard',
+       'nostalgia'             => 'Nostalgia',
+       'cologneblue'   => 'CologneBlue'
 );
 if( $wgUsePHPTal ) {
     #$wgValidSkinNames[] = 'PHPTal';
@@ -177,7 +176,7 @@ class Skin {
                                $s .= $wgRequest->getText('wpTextbox1');
                        } else {
                                $userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
-                               $s.= '@import "'.$this->makeUrl($userpage.'/'.$this->getSkinName(), 'action=raw&ctype=text/css').'";'."\n";
+                               $s.= '@import "'.$this->makeUrl($userpage.'/'.$this->getSkinName().'.css', 'action=raw&ctype=text/css').'";'."\n";
                        }
                }
                $s .= $this->doGetUserStyles();
@@ -1085,6 +1084,7 @@ class Skin {
        function specialPagesList()
        {
                global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
+               require_once('SpecialPage.php');
                $a = array();
                $pages = SpecialPage::getPages();
                
@@ -1559,7 +1559,7 @@ class Skin {
        # Pass a title object, not a title string
        function makeKnownLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '')
        {
-               global $wgOut, $wgTitle;
+               global $wgOut, $wgTitle, $wgInputEncoding;
 
                $fname = 'Skin::makeKnownLinkObj';
                wfProfileIn( $fname );
@@ -1575,7 +1575,12 @@ class Skin {
                        $u = $nt->escapeLocalURL( $query );
                }
                if ( '' != $nt->getFragment() ) {
-                       $u .= '#' . htmlspecialchars( $nt->getFragment() );
+                       $anchor = urlencode( do_html_entity_decode( str_replace(' ', '_', $nt->getFragment()), ENT_COMPAT, $wgInputEncoding ) );
+                       $replacearray = array(
+                               '%3A' => ':',
+                               '%' => '.'
+                       );
+                       $u .= '#' . str_replace(array_keys($replacearray),array_values($replacearray),$anchor);
                }
                if ( '' == $text ) {
                        $text = htmlspecialchars( $nt->getPrefixedText() );
@@ -2757,14 +2762,4 @@ class Skin {
        }
 
 }
-
-require_once( 'SkinStandard.php' );
-require_once( 'SkinNostalgia.php' );
-require_once( 'SkinCologneBlue.php' );
-
-if( $wgUsePHPTal ) {
-       require_once( 'SkinPHPTal.php' );
-}
-
-
 ?>