From: Brion Vibber Date: Tue, 8 May 2007 20:58:57 +0000 (+0000) Subject: * (bug 9808) Fix regression that ignored user 'rclimit' option for Special:Contributions X-Git-Tag: 1.31.0-rc.0~53015 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=62aa7769ac5c566b7b18fb8578f3b68767eaa689;p=lhc%2Fweb%2Fwiklou.git * (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. --- diff --git a/includes/Pager.php b/includes/Pager.php index 54a269eedd..a475dc16a1 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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 );