From c8136cd6a2119ae1978f687bc3d80ddb98df00f3 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 18 Nov 2007 02:33:30 +0000 Subject: [PATCH] Feeds for recent changes now provide URLs for the change (i.e., the diff), not just the page. This matches behavior of history feeds, which appears more correct. Incidentally, this code needs centralization, probably, say into a constructor method of Revision or Article. Logic is unnecessarily duplicated at present. (Also tweaked some docs, used __METHOD__ instead of $fname.) --- RELEASE-NOTES | 2 ++ includes/Feed.php | 1 + includes/SpecialRecentchanges.php | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index da9a217239..9b814c5a49 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -157,6 +157,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN pages which had spaces in theirs names * If restricted read access was enabled, requests for non-existing special pages threw an exception +* Feeds for recent changes now provide correct URLs for the change, not just + the page === API changes in 1.12 === diff --git a/includes/Feed.php b/includes/Feed.php index ed4343c31b..503b43bdce 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -41,6 +41,7 @@ class FeedItem { /**#@+ * @todo document + * @param $Url URL uniquely designating the item. */ function __construct( $Title, $Description, $Url, $Date = '', $Author = '', $Comments = '' ) { $this->Title = $Title; diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 2744cd8f55..4fae63511e 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -379,9 +379,12 @@ function rcOutputFeed( $rows, $feedFormat, $limit, $hideminor, $lastmod ) { return true; } +/** + * @todo document + * @param $rows Database resource with recentchanges rows + */ function rcDoOutputFeed( $rows, &$feed ) { - $fname = 'rcDoOutputFeed'; - wfProfileIn( $fname ); + wfProfileIn( __METHOD__ ); $feed->outHeader(); @@ -406,7 +409,7 @@ function rcDoOutputFeed( $rows, &$feed ) { $item = new FeedItem( $title->getPrefixedText(), rcFormatDiff( $obj ), - $title->getFullURL(), + $title->getFullURL( 'diff=' . $obj->rc_this_oldid . '&oldid=prev' ), $obj->rc_timestamp, $obj->rc_user_text, $talkpage->getFullURL() @@ -414,7 +417,7 @@ function rcDoOutputFeed( $rows, &$feed ) { $feed->outItem( $item ); } $feed->outFooter(); - wfProfileOut( $fname ); + wfProfileOut( __METHOD__ ); } /** -- 2.20.1