(bug 15617)
authorX! <soxred93@users.mediawiki.org>
Tue, 16 Sep 2008 03:58:18 +0000 (03:58 +0000)
committerX! <soxred93@users.mediawiki.org>
Tue, 16 Sep 2008 03:58:18 +0000 (03:58 +0000)
$wgFeedClassesOutputPage::getHeadLinks() respects $wgFeedClasses, instead of hardcoding rss and atom.
Patch by Juliano F. Ravasi.

RELEASE-NOTES
includes/OutputPage.php

index b119e13..d410705 100644 (file)
@@ -206,6 +206,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   even if there are broken link records with source article id 0 in the database
 * (bug 15598) Special:Newpages default limit uses user preference for recentchanges
   limit instead of hardcoded 50.
+* (bug 15617) $wgFeedClassesOutputPage::getHeadLinks() respects $wgFeedClasses, instead of hardcoding rss and atom. Patch by Juliano F. Ravasi. 
 
 === API changes in 1.14 ===
 
index 17a774d..e571c8e 100644 (file)
@@ -1533,7 +1533,7 @@ class OutputPage {
                        # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
                        # If so, use it instead.
                        
-                       global $wgOverrideSiteFeed, $wgSitename;
+                       global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses;
                        $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
                        
                        if ( $wgOverrideSiteFeed ) {
@@ -1545,14 +1545,12 @@ class OutputPage {
                                }
                        }
                        else if ( $wgTitle->getPrefixedText() != $rctitle->getPrefixedText() ) {
-                               $tags[] = $this->feedLink(
-                                       'rss',
-                                       $rctitle->getFullURL( 'feed=rss' ),
-                                       wfMsg( 'site-rss-feed', $wgSitename ) );
-                               $tags[] = $this->feedLink(
-                                       'atom',
-                                       $rctitle->getFullURL( 'feed=atom' ),
-                                       wfMsg( 'site-atom-feed', $wgSitename ) );
+                               foreach( $wgFeedClasses as $format => $class ) {
+                                       $tags[] = $this->feedLink(
+                                               $format,
+                                               $rctitle->getFullURL( "feed={$format}" ),
+                                               wfMsg( "site-{$format}-feed", $wgSitename ) ); # For grep: 'site-rss-feed', 'site-atom-feed'.
+                               }
                        }
                }