* Do not log user rights change that didn't change anything
* (bug 12584) Don't reset cl_timestamp when auto-updating sort key on move
* (bug 12588) Fix selection in namespace selector on Special:Newpages
+* Use only default options when generating RSS and Atom syndication links.
+ This should help prevent infinite link loops that some software may follow,
+ and will generally keep feed behavior cleaner.
== Parser changes in 1.12 ==
$ret .= " />\n";
}
- if( $this->isSyndicated() ) {
+ 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, $wgFeedClasses;
-
- if( is_string( $this->getFeedAppendQuery() ) ) {
- $appendQuery = "&" . $this->getFeedAppendQuery();
- } else {
- $appendQuery = "";
- }
+ global $wgTitle;
- foreach( $wgFeedClasses as $format => $class ) {
- $ret .= $this->feedLink(
- $format,
- $wgRequest->appendQuery( "feed=$format{$appendQuery}" ),
- wfMsg( "page-{$format}-feed", $wgTitle->getPrefixedText() ) );
- }
+ $ret .= $this->feedLink(
+ $format,
+ $link,
+ wfMsg( "page-{$format}-feed", $wgTitle->getPrefixedText() ) );
}
# Recent changes feed should appear on every page
return $ret;
}
+ /**
+ * Return URLs for each supported syndication format for this page.
+ * @return array associating format keys with URLs
+ */
+ public function getSyndicationLinks() {
+ global $wgTitle, $wgFeedClasses;
+ $links = array();
+
+ if( $this->isSyndicated() ) {
+ if( is_string( $this->getFeedAppendQuery() ) ) {
+ $appendQuery = "&" . $this->getFeedAppendQuery();
+ } else {
+ $appendQuery = "";
+ }
+
+ foreach( $wgFeedClasses as $format => $class ) {
+ $links[$format] = $wgTitle->getLocalUrl( "feed=$format{$appendQuery}" );
+ }
+ }
+ return $links;
+ }
+
/**
* Generate a <link rel/> for an RSS feed.
*/
$wgOut->setArticleRelated( true );
$wgOut->setRobotpolicy( 'noindex,nofollow' );
$wgOut->setSyndicated( true );
+ $wgOut->setFeedAppendQuery( 'action=history' );
$logPage = SpecialPage::getTitleFor( 'Log' );
$logLink = $this->mSkin->makeKnownLinkObj( $logPage, wfMsgHtml( 'viewpagelogs' ), 'page=' . $this->mTitle->getPrefixedUrl() );
$tpl->set( 'catlinks', $this->getCategories());
if( $wgOut->isSyndicated() ) {
$feeds = array();
- foreach( $wgFeedClasses as $format => $class ) {
- $linktext = $format;
- if ( $format == "atom" ) {
- $linktext = wfMsg( 'feed-atom' );
- } else if ( $format == "rss" ) {
- $linktext = wfMsg( 'feed-rss' );
- }
- if( is_string( $wgOut->getFeedAppendQuery() ) ) {
- $appendQuery = "&" . $wgOut->getFeedAppendQuery();
- } else {
- $appendQuery = "";
- }
+ foreach( $wgOut->getSyndicationLinks() as $format => $link ) {
$feeds[$format] = array(
- 'text' => $linktext,
- 'href' => $wgRequest->appendQuery( "feed={$format}{$appendQuery}" )
- );
+ 'text' => wfMsg( "feed-$format" ),
+ 'href' => $link );
}
$tpl->setRef( 'feeds', $feeds );
} else {