* (bug 9808) Fix regression that ignored user 'rclimit' option for Special:Contributions
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 8 May 2007 20:58:57 +0000 (20:58 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 8 May 2007 20:58:57 +0000 (20:58 +0000)
Use the general limiting behavior from WebRequest to fill the 'limit' field on IndexPager views.

includes/Pager.php

index 54a269e..a475dc1 100644 (file)
@@ -72,17 +72,18 @@ abstract class IndexPager implements Pager {
        public $mResult;
 
        function __construct() {
-               global $wgRequest;
+               global $wgRequest, $wgUser;
                $this->mRequest = $wgRequest;
-
+               
                # NB: the offset is quoted, not validated. It is treated as an arbitrary string
                # to support the widest variety of index types. Be careful outputting it into 
                # HTML!
                $this->mOffset = $this->mRequest->getText( 'offset' );
-               $this->mLimit = $this->mRequest->getInt( 'limit', $this->mDefaultLimit );
-               if ( $this->mLimit <= 0 || $this->mLimit > 50000 ) {
-                       $this->mLimit = $this->mDefaultLimit;
-               }
+               
+               # Use consistent behavior for the limit options
+               $this->mDefaultLimit = intval( $wgUser->getOption( 'rclimit' ) );
+               list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
+               
                $this->mIsBackwards = ( $this->mRequest->getVal( 'dir' ) == 'prev' );
                $this->mIndexField = $this->getIndexField();
                $this->mDb = wfGetDB( DB_SLAVE );