r37699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37698‎ | r37699 | r37700 >
Date:16:00, 15 July 2008
Author:demon
Status:old
Tags:
Comment:
(bug 14778) 'limit' parameter now applies to history feeds as well as history pages (and now doesn't break if the limit is negative)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -494,7 +494,7 @@
495495 * @param string $type
496496 */
497497 function feed( $type ) {
498 - global $wgFeedClasses;
 498+ global $wgFeedClasses, $wgRequest, $wgFeedLimit;
499499 if ( !FeedUtils::checkFeedOutput($type) ) {
500500 return;
501501 }
@@ -505,7 +505,14 @@
506506 wfMsgForContent( 'history-feed-description' ),
507507 $this->mTitle->getFullUrl( 'action=history' ) );
508508
509 - $items = $this->fetchRevisions(10, 0, PageHistory::DIR_NEXT);
 509+ // Get a limit on number of feed entries. Provide a sane default
 510+ // of 10 if none is defined (but limit to $wgFeedLimit max)
 511+ $limit = $wgRequest->getInt( 'limit', 10 );
 512+ if( $limit > $wgFeedLimit || $limit < 1 ) {
 513+ $limit = 10;
 514+ }
 515+ $items = $this->fetchRevisions($limit, 0, PageHistory::DIR_NEXT);
 516+
510517 $feed->outHeader();
511518 if( $items ) {
512519 foreach( $items as $row ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -444,6 +444,8 @@
445445 * (bug 451) Improve the phrase mappings of the Chinese converter arrays.
446446 * (bug 12487) Rights log is not fully internationalized
447447 * (bug 10837) Language variants no longer override other languages than base
 448+* (bug 14778) 'limit' parameter now applies to history feeds as well as
 449+ history pages
448450
449451 === API changes in 1.13 ===
450452

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37508(bug 14778) 'limit' parameter now applies to history feeds as well as history...demon14:53, 10 July 2008
r37536Revert r37508 for now ((bug 14778) 'limit' parameter now applies to history f...brion21:34, 10 July 2008

Status & tagging log