* Use OutputPage::getSyndicationLinks() to build feed links
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 19 Feb 2011 14:40:56 +0000 (14:40 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 19 Feb 2011 14:40:56 +0000 (14:40 +0000)
* Ported r82395 to legacy skins (possible double "printable" parameter in URL and hidden dependency of $wgTitle)

includes/SkinLegacy.php

index 0f304a9..201c3f0 100644 (file)
@@ -566,18 +566,19 @@ class LegacyTemplate extends BaseTemplate {
        }
 
        function printableLink() {
-               global $wgOut, $wgFeedClasses, $wgRequest, $wgLang;
+               global $wgOut, $wgRequest, $wgLang;
 
                $s = array();
 
                if ( !$wgOut->isPrintable() ) {
-                       $printurl = $wgRequest->escapeAppendQuery( 'printable=yes' );
+                       $printurl = htmlspecialchars( $this->getSkin()->getTitle()->getLocalUrl(
+                               $wgRequest->appendQueryValue( 'printable', 'yes', true ) ) );
                        $s[] = "<a href=\"$printurl\" rel=\"alternate\">" . wfMsg( 'printableversion' ) . '</a>';
                }
 
                if ( $wgOut->isSyndicated() ) {
-                       foreach ( $wgFeedClasses as $format => $class ) {
-                               $feedurl = $wgRequest->escapeAppendQuery( "feed=$format" );
+                       foreach ( $wgOut->getSyndicationLinks() as $format => $link ) {
+                               $feedurl = htmlspecialchars( $link );
                                $s[] = "<a href=\"$feedurl\" rel=\"alternate\" type=\"application/{$format}+xml\""
                                                . " class=\"feedlink\">" . wfMsgHtml( "feed-$format" ) . "</a>";
                        }