X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FQueryPage.php;h=1f21584080552adf2832cfffee9c195813619979;hb=a4aef7d4952ce7b1887a4ba4f5c605e1c09cc770;hp=501fd2fe32b5b2a3ca218cd8eb1a32d2c716efe6;hpb=e676c6953fad3c9b29f50216f1b082a13738bf20;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 501fd2fe32..1f21584080 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -45,6 +45,7 @@ $wgQueryPages = array( array( 'MIMEsearchPage', 'MIMEsearch' ), array( 'MostcategoriesPage', 'Mostcategories' ), array( 'MostimagesPage', 'Mostimages' ), + array( 'MostinterwikisPage', 'Mostinterwikis' ), array( 'MostlinkedCategoriesPage', 'Mostlinkedcategories' ), array( 'MostlinkedtemplatesPage', 'Mostlinkedtemplates' ), array( 'MostlinkedPage', 'Mostlinked' ), @@ -150,6 +151,7 @@ abstract class QueryPage extends SpecialPage { /** * For back-compat, subclasses may return a raw SQL query here, as a string. * This is stronly deprecated; getQueryInfo() should be overridden instead. + * @throws MWException * @return string */ function getSQL() { @@ -432,9 +434,9 @@ abstract class QueryPage extends SpecialPage { $options['ORDER BY'] = 'qc_value ASC'; } $res = $dbr->select( 'querycache', array( 'qc_type', - 'qc_namespace AS namespace', - 'qc_title AS title', - 'qc_value AS value' ), + 'namespace' => 'qc_namespace', + 'title' => 'qc_title', + 'value' => 'qc_value' ), array( 'qc_type' => $this->getName() ), __METHOD__, $options ); @@ -526,7 +528,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 +560,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 } /**