From: umherirrender Date: Tue, 31 Dec 2013 16:44:43 +0000 (+0100) Subject: action=feedcontributions no longer has one item more than limit X-Git-Tag: 1.31.0-rc.0~17439^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=dd4a8a5154c2152bbf3d6ec5feb6143cc062bef7;p=lhc%2Fweb%2Fwiklou.git action=feedcontributions no longer has one item more than limit The extra one is used for navigation on Special:Contributions, but that is not needed on the rss feed. Bug: 57874 Change-Id: Id56b0da7e921df9cbdb09e90611d226bf224804d --- diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index a43ab0361f..d13f9cd55e 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -92,6 +92,7 @@ production. properly for all parameters. * ApiQueryBase::titlePartToKey allows an extra parameter that indicates the namespace in order to properly capitalize the title part. +* (bug 57874) action=feedcontributions no longer has one item more than limit. === Languages updated in 1.23 === diff --git a/includes/api/ApiFeedContributions.php b/includes/api/ApiFeedContributions.php index bf69410356..f90ba988e3 100644 --- a/includes/api/ApiFeedContributions.php +++ b/includes/api/ApiFeedContributions.php @@ -87,7 +87,13 @@ class ApiFeedContributions extends ApiBase { $feedItems = array(); if ( $pager->getNumRows() > 0 ) { + $count = 0; + $limit = $pager->getLimit(); foreach ( $pager->mResult as $row ) { + // ContribsPager selects one more row for navigation, skip that row + if ( ++$count > $limit ) { + break; + } $feedItems[] = $this->feedItem( $row ); } }