Index: trunk/phase3/includes/PageHistory.php |
— | — | @@ -494,7 +494,7 @@ |
495 | 495 | * @param string $type |
496 | 496 | */ |
497 | 497 | function feed( $type ) { |
498 | | - global $wgFeedClasses; |
| 498 | + global $wgFeedClasses, $wgRequest, $wgFeedLimit; |
499 | 499 | if ( !FeedUtils::checkFeedOutput($type) ) { |
500 | 500 | return; |
501 | 501 | } |
— | — | @@ -505,7 +505,14 @@ |
506 | 506 | wfMsgForContent( 'history-feed-description' ), |
507 | 507 | $this->mTitle->getFullUrl( 'action=history' ) ); |
508 | 508 | |
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 | + |
510 | 517 | $feed->outHeader(); |
511 | 518 | if( $items ) { |
512 | 519 | foreach( $items as $row ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -444,6 +444,8 @@ |
445 | 445 | * (bug 451) Improve the phrase mappings of the Chinese converter arrays. |
446 | 446 | * (bug 12487) Rights log is not fully internationalized |
447 | 447 | * (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 |
448 | 450 | |
449 | 451 | === API changes in 1.13 === |
450 | 452 | |