* (bug 21738) Fix for r57119: OutputPage::setSyndicated() now works again (was breaki...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 13 Jan 2010 20:23:14 +0000 (20:23 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 13 Jan 2010 20:23:14 +0000 (20:23 +0000)
includes/OutputPage.php

index b1ca97a..6498edc 100644 (file)
@@ -393,7 +393,13 @@ class OutputPage {
        public function disable() { $this->mDoNothing = true; }
        public function isDisabled() { return $this->mDoNothing; }
 
-       public function setSyndicated( $show = true ) { $this->mShowFeedLinks = $show; }
+       public function setSyndicated( $show = true ) {
+               if ( $show ) {
+                       $this->setFeedAppendQuery( false );
+               } else {
+                       $this->mFeedLinks = array();
+               }
+       }
 
        public function setFeedAppendQuery( $val ) {
                global $wgFeedClasses;
@@ -401,7 +407,9 @@ class OutputPage {
                $this->mFeedLinks = array();
 
                foreach( $wgFeedClasses as $type => $class ) {
-                       $query = "feed=$type&".$val;
+                       $query = "feed=$type";
+                       if ( is_string( $val ) )
+                               $query .= '&' . $val;
                        $this->mFeedLinks[$type] = $this->getTitle()->getLocalURL( $query );
                }
        }