aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorDannyS712 <DannyS712.enwiki@gmail.com>2020-02-19 00:47:46 +0000
committerDannyS712 <DannyS712.enwiki@gmail.com>2020-02-19 00:50:21 +0000
commit3d8e6c6448b260ee8ca259d5e2aaffddaffccee7 (patch)
tree655fdb1a65b9b608be38ed9dfef77eed5ba91b57 /includes
parent4b878444697d0b74943fe734a5a80f08967517aa (diff)
downloadmediawikicore-3d8e6c6448b260ee8ca259d5e2aaffddaffccee7.tar.gz
mediawikicore-3d8e6c6448b260ee8ca259d5e2aaffddaffccee7.zip
Replace WebRequest::getLimitOffset with ::getLimitOffsetForUser
Bug: T243805 Change-Id: I8b084e447e12a330bdce2bff18fd7c756ac5f698
Diffstat (limited to 'includes')
-rw-r--r--includes/page/ImageHistoryPseudoPager.php6
-rw-r--r--includes/pager/IndexPager.php5
-rw-r--r--includes/specialpage/QueryPage.php5
-rw-r--r--includes/specials/SpecialSearch.php6
4 files changed, 16 insertions, 6 deletions
diff --git a/includes/page/ImageHistoryPseudoPager.php b/includes/page/ImageHistoryPseudoPager.php
index 06dad7ff47af..14130b5c3468 100644
--- a/includes/page/ImageHistoryPseudoPager.php
+++ b/includes/page/ImageHistoryPseudoPager.php
@@ -66,7 +66,11 @@ class ImageHistoryPseudoPager extends ReverseChronologicalPager {
$this->mLimitsShown = array_merge( [ 10 ], $this->mLimitsShown );
$this->mDefaultLimit = 10;
list( $this->mLimit, /* $offset */ ) =
- $this->mRequest->getLimitOffset( $this->mDefaultLimit, '' );
+ $this->mRequest->getLimitOffsetForUser(
+ $this->getUser(),
+ $this->mDefaultLimit,
+ ''
+ );
}
/**
diff --git a/includes/pager/IndexPager.php b/includes/pager/IndexPager.php
index 3ae232df87f7..523fa7be9084 100644
--- a/includes/pager/IndexPager.php
+++ b/includes/pager/IndexPager.php
@@ -178,7 +178,8 @@ abstract class IndexPager extends ContextSource implements Pager {
$this->mDefaultLimit = $this->getUser()->getIntOption( 'rclimit' );
if ( !$this->mLimit ) {
// Don't override if a subclass calls $this->setLimit() in its constructor.
- list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
+ list( $this->mLimit, /* $offset */ ) = $this->mRequest
+ ->getLimitOffsetForUser( $this->getUser() );
}
$this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
@@ -309,7 +310,7 @@ abstract class IndexPager extends ContextSource implements Pager {
*/
function setLimit( $limit ) {
$limit = (int)$limit;
- // WebRequest::getLimitOffset() puts a cap of 5000, so do same here.
+ // WebRequest::getLimitOffsetForUser() puts a cap of 5000, so do same here.
if ( $limit > 5000 ) {
$limit = 5000;
}
diff --git a/includes/specialpage/QueryPage.php b/includes/specialpage/QueryPage.php
index 0fbc2497ec88..785209495046 100644
--- a/includes/specialpage/QueryPage.php
+++ b/includes/specialpage/QueryPage.php
@@ -547,7 +547,7 @@ abstract class QueryPage extends SpecialPage {
}
/**
- * Returns limit and offset, as returned by $this->getRequest()->getLimitOffset().
+ * Returns limit and offset, as returned by $this->getRequest()->getLimitOffsetForUser().
* Subclasses may override this to further restrict or modify limit and offset.
*
* @note Restricts the offset parameter, as most query pages have inefficient paging
@@ -559,7 +559,8 @@ abstract class QueryPage extends SpecialPage {
* @return int[] list( $limit, $offset )
*/
protected function getLimitOffset() {
- list( $limit, $offset ) = $this->getRequest()->getLimitOffset();
+ list( $limit, $offset ) = $this->getRequest()
+ ->getLimitOffsetForUser( $this->getUser() );
if ( $this->getConfig()->get( 'MiserMode' ) ) {
$maxResults = $this->getMaxResults();
// Can't display more than max results on a page
diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php
index 80f082d7aad1..88d2be3b82d6 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -213,7 +213,11 @@ class SpecialSearch extends SpecialPage {
$this->loadStatus = new Status();
$request = $this->getRequest();
- list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, '' );
+ list( $this->limit, $this->offset ) = $request->getLimitOffsetForUser(
+ $this->getUser(),
+ 20,
+ ''
+ );
$this->mPrefix = $request->getVal( 'prefix', '' );
if ( $this->mPrefix !== '' ) {
$this->setExtraParam( 'prefix', $this->mPrefix );