r22010 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22009‎ | r22010 | r22011 >
Date:20:58, 8 May 2007
Author:brion
Status:old
Tags:
Comment:
* (bug 9808) Fix regression that ignored user 'rclimit' option for Special:Contributions
Use the general limiting behavior from WebRequest to fill the 'limit' field on IndexPager views.
Modified paths:
  • /trunk/phase3/includes/Pager.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Pager.php
@@ -72,17 +72,18 @@
7373 public $mResult;
7474
7575 function __construct() {
76 - global $wgRequest;
 76+ global $wgRequest, $wgUser;
7777 $this->mRequest = $wgRequest;
78 -
 78+
7979 # NB: the offset is quoted, not validated. It is treated as an arbitrary string
8080 # to support the widest variety of index types. Be careful outputting it into
8181 # HTML!
8282 $this->mOffset = $this->mRequest->getText( 'offset' );
83 - $this->mLimit = $this->mRequest->getInt( 'limit', $this->mDefaultLimit );
84 - if ( $this->mLimit <= 0 || $this->mLimit > 50000 ) {
85 - $this->mLimit = $this->mDefaultLimit;
86 - }
 83+
 84+ # Use consistent behavior for the limit options
 85+ $this->mDefaultLimit = intval( $wgUser->getOption( 'rclimit' ) );
 86+ list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
 87+
8788 $this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
8889 $this->mIndexField = $this->getIndexField();
8990 $this->mDb = wfGetDB( DB_SLAVE );

Follow-up revisions

RevisionCommit summaryAuthorDate
r22011Merge trunk rr22010...brion21:08, 8 May 2007