r37508 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37507‎ | r37508 | r37509 >
Date:14:53, 10 July 2008
Author:demon
Status:old
Tags:
Comment:
(bug 14778) 'limit' parameter now applies to history feeds as well as history pages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -501,7 +501,7 @@
502502 * @param string $type
503503 */
504504 function feed( $type ) {
505 - global $wgFeedClasses;
 505+ global $wgFeedClasses, $wgRequest, $wgFeedLimit;
506506 if ( !FeedUtils::checkFeedOutput($type) ) {
507507 return;
508508 }
@@ -512,7 +512,14 @@
513513 wfMsgForContent( 'history-feed-description' ),
514514 $this->mTitle->getFullUrl( 'action=history' ) );
515515
516 - $items = $this->fetchRevisions(10, 0, PageHistory::DIR_NEXT);
 516+ // Get a limit on number of feed entries. Provide a sane default
 517+ // of 10 if none is defined (but limit to $wgFeedLimit max)
 518+ $limit = $wgRequest->getInt( 'limit', 10 );
 519+ if( $limit > $wgFeedLimit ) {
 520+ $limit = $wgFeedLimit;
 521+ }
 522+ $items = $this->fetchRevisions($limit, 0, PageHistory::DIR_NEXT);
 523+
517524 $feed->outHeader();
518525 if( $items ) {
519526 foreach( $items as $row ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -432,6 +432,8 @@
433433 * (bug 14763) Child classes of Database (DatabasePostgres and DatabaseOracle)
434434 had stict standards issues with setFakeSlaveLag() and setFakeMaster().
435435 * (bug 451) Improve the phrase mappings of the Chinese converter arrays.
 436+* (bug 14778) 'limit' parameter now applies to history feeds as well as
 437+ history pages
436438
437439 === API changes in 1.13 ===
438440

Follow-up revisions

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

Status & tagging log