* @return string HTML tag links to be put in the header.
*/
public function getHeadLinks() {
- global $wgRequest;
+ global $wgRequest, $wgFeed;
$ret = '';
foreach ( $this->mMetatags as $tag ) {
if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
$ret .= " />\n";
}
- foreach( $this->getSyndicationLinks() as $format => $link ) {
- # Use the page name for the title (accessed through $wgTitle since
- # there's no other way). In principle, this could lead to issues
- # with having the same name for different feeds corresponding to
- # the same page, but we can't avoid that at this low a level.
- global $wgTitle;
-
+ if( $wgFeed ) {
+ foreach( $this->getSyndicationLinks() as $format => $link ) {
+ # Use the page name for the title (accessed through $wgTitle since
+ # there's no other way). In principle, this could lead to issues
+ # with having the same name for different feeds corresponding to
+ # the same page, but we can't avoid that at this low a level.
+ global $wgTitle;
+
+ $ret .= $this->feedLink(
+ $format,
+ $link,
+ wfMsg( "page-{$format}-feed", $wgTitle->getPrefixedText() ) ); # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
+ }
+
+ # Recent changes feed should appear on every page
+ # Put it after the per-page feed to avoid changing existing behavior.
+ # It's still available, probably via a menu in your browser.
+ global $wgSitename;
+ $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
+ $ret .= $this->feedLink(
+ 'rss',
+ $rctitle->getFullURL( 'feed=rss' ),
+ wfMsg( 'site-rss-feed', $wgSitename ) );
$ret .= $this->feedLink(
- $format,
- $link,
- wfMsg( "page-{$format}-feed", $wgTitle->getPrefixedText() ) ); # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
+ 'atom',
+ $rctitle->getFullURL( 'feed=atom' ),
+ wfMsg( 'site-atom-feed', $wgSitename ) );
}
- # Recent changes feed should appear on every page
- # Put it after the per-page feed to avoid changing existing behavior.
- # It's still available, probably via a menu in your browser.
- global $wgSitename;
- $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
- $ret .= $this->feedLink(
- 'rss',
- $rctitle->getFullURL( 'feed=rss' ),
- wfMsg( 'site-rss-feed', $wgSitename ) );
- $ret .= $this->feedLink(
- 'atom',
- $rctitle->getFullURL( 'feed=atom' ),
- wfMsg( 'site-atom-feed', $wgSitename ) );
-
return $ret;
}
function rcOutputFeed( $rows, $feedFormat, $limit, $hideminor, $lastmod ) {
global $messageMemc, $wgFeedCacheTimeout;
global $wgFeedClasses, $wgTitle, $wgSitename, $wgContLanguageCode;
+ global $wgFeed;
+
+ if ( !$wgFeed ) {
+ global $wgOut;
+ $wgOut->addWikiMsg( 'feed-unavailable' );
+ return;
+ }
if( !isset( $wgFeedClasses[$feedFormat] ) ) {
wfHttpError( 500, "Internal Server Error", "Unsupported feed type." );