Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2946,6 +2946,12 @@ |
2947 | 2947 | $wgOverrideSiteFeed = array(); |
2948 | 2948 | |
2949 | 2949 | /** |
| 2950 | + * Which feed types should we provide by default? This can include 'rss', |
| 2951 | + * 'atom', neither, or both. |
| 2952 | + */ |
| 2953 | +$wgAdvertisedFeedTypes = array( 'rss' ); |
| 2954 | + |
| 2955 | +/** |
2950 | 2956 | * Additional namespaces. If the namespaces defined in Language.php and |
2951 | 2957 | * Namespace.php are insufficient, you can create new ones here, for example, |
2952 | 2958 | * to import Help files in other languages. |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -402,14 +402,15 @@ |
403 | 403 | } |
404 | 404 | |
405 | 405 | public function setFeedAppendQuery( $val ) { |
406 | | - global $wgFeedClasses; |
| 406 | + global $wgFeedClasses, $wgAdvertisedFeedTypes; |
407 | 407 | |
408 | 408 | $this->mFeedLinks = array(); |
409 | 409 | |
410 | | - foreach( $wgFeedClasses as $type => $class ) { |
| 410 | + foreach ( $wgAdvertisedFeedTypes as $type ) { |
411 | 411 | $query = "feed=$type"; |
412 | | - if ( is_string( $val ) ) |
| 412 | + if ( is_string( $val ) ) { |
413 | 413 | $query .= '&' . $val; |
| 414 | + } |
414 | 415 | $this->mFeedLinks[$type] = $this->getTitle()->getLocalURL( $query ); |
415 | 416 | } |
416 | 417 | } |
— | — | @@ -1779,7 +1780,8 @@ |
1780 | 1781 | $tags[] = $this->feedLink( |
1781 | 1782 | $format, |
1782 | 1783 | $link, |
1783 | | - wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) ); # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep) |
| 1784 | + # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep) |
| 1785 | + wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) ); |
1784 | 1786 | } |
1785 | 1787 | |
1786 | 1788 | # Recent changes feed should appear on every page (except recentchanges, |
— | — | @@ -1790,7 +1792,7 @@ |
1791 | 1793 | # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined. |
1792 | 1794 | # If so, use it instead. |
1793 | 1795 | |
1794 | | - global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses; |
| 1796 | + global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses, $wgAdvertisedFeedTypes; |
1795 | 1797 | $rctitle = SpecialPage::getTitleFor( 'Recentchanges' ); |
1796 | 1798 | |
1797 | 1799 | if ( $wgOverrideSiteFeed ) { |
— | — | @@ -1800,9 +1802,8 @@ |
1801 | 1803 | htmlspecialchars( $feedUrl ), |
1802 | 1804 | wfMsg( "site-{$type}-feed", $wgSitename ) ); |
1803 | 1805 | } |
1804 | | - } |
1805 | | - else if ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) { |
1806 | | - foreach( $wgFeedClasses as $format => $class ) { |
| 1806 | + } elseif ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) { |
| 1807 | + foreach ( $wgAdvertisedFeedTypes as $format ) { |
1807 | 1808 | $tags[] = $this->feedLink( |
1808 | 1809 | $format, |
1809 | 1810 | $rctitle->getLocalURL( "feed={$format}" ), |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -91,6 +91,9 @@ |
92 | 92 | If not specified it will default to $wgScriptPath/extensions |
93 | 93 | * Added $wgCountTotalSearchHits to make search UI display total number of hits |
94 | 94 | with some search engines. |
| 95 | +* Added $wgAdvertisedFeedTypes to decide what feed types (RSS, Atom, both, or |
| 96 | + neither) MediaWiki advertises. Default is array( 'rss' ), so Atom is no |
| 97 | + longer advertised by default (but it still works). |
95 | 98 | |
96 | 99 | |
97 | 100 | === New features in 1.16 === |