From 33abda08a9901c09047d56888c3c56bece1bd4de Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 16 Aug 2012 17:40:28 +0200 Subject: [PATCH] (bug 39429) Fix wrong counting on query pages [regression] Change-Id: I1c5be7cd6b3dd0990dba8f30f9d859aa841a1f55 --- includes/QueryPage.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 076b1b5a6c..e188d3b8e9 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -526,7 +526,8 @@ abstract class QueryPage extends SpecialPage { $out->addHTML( $this->getPageHeader() ); if ( $this->numRows > 0 ) { $out->addHTML( $this->msg( 'showingresults' )->numParams( - $this->numRows, $this->offset + 1 )->parseAsBlock() ); + min( $this->numRows, $this->limit ), # do not show the one extra row, if exist + $this->offset + 1 )->parseAsBlock() ); # Disable the "next" link when we reach the end $paging = $this->getLanguage()->viewPrevNext( $this->getTitle( $par ), $this->offset, $this->limit, $this->linkParameters(), ( $this->numRows <= $this->limit ) ); @@ -557,7 +558,7 @@ abstract class QueryPage extends SpecialPage { $out->addHTML( Xml::closeElement( 'div' ) ); - return $this->numRows; + return min( $this->numRows, $this->limit ); # do not return the one extra row, if exist } /** -- 2.20.1