r82346 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82345‎ | r82346 | r82347 >
Date:19:26, 17 February 2011
Author:ialex
Status:ok
Tags:
Comment:
Pass the url to ChangesFeed::getFeedObject() instead of grabbing it from $wgTitle
(no use of that function in extensions)
Modified paths:
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ChangesFeed.php
@@ -24,15 +24,19 @@
2525 *
2626 * @param $title String: feed's title
2727 * @param $description String: feed's description
 28+ * @param $url String: url of origin page
2829 * @return ChannelFeed subclass or false on failure
2930 */
30 - public function getFeedObject( $title, $description ) {
31 - global $wgSitename, $wgLanguageCode, $wgFeedClasses, $wgTitle;
 31+ public function getFeedObject( $title, $description, $url ) {
 32+ global $wgSitename, $wgLanguageCode, $wgFeedClasses;
 33+
 34+ if ( !isset( $wgFeedClasses[$this->format] ) ) {
 35+ return false;
 36+ }
 37+
3238 $feedTitle = "$wgSitename - {$title} [$wgLanguageCode]";
33 - if( !isset($wgFeedClasses[$this->format] ) )
34 - return false;
3539 return new $wgFeedClasses[$this->format](
36 - $feedTitle, htmlspecialchars( $description ), $wgTitle->getFullUrl() );
 40+ $feedTitle, htmlspecialchars( $description ), $url );
3741 }
3842
3943 /**
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -56,7 +56,8 @@
5757 $feed = new ChangesFeed( $feedFormat, false );
5858 $feedObj = $feed->getFeedObject(
5959 wfMsgForContent( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() ),
60 - wfMsgForContent( 'recentchangeslinked-feed' )
 60+ wfMsgForContent( 'recentchangeslinked-feed' ),
 61+ $this->getTitle()->getFullUrl()
6162 );
6263 return array( $feed, $feedObj );
6364 }
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -169,7 +169,8 @@
170170 $changesFeed = new ChangesFeed( $feedFormat, 'rcfeed' );
171171 $formatter = $changesFeed->getFeedObject(
172172 wfMsgForContent( 'recentchanges' ),
173 - wfMsgForContent( 'recentchanges-feed-description' )
 173+ wfMsgForContent( 'recentchanges-feed-description' ),
 174+ $this->getTitle()->getFullUrl()
174175 );
175176 return array( $changesFeed, $formatter );
176177 }

Status & tagging log