From: Chad Date: Tue, 11 Feb 2014 01:03:45 +0000 (+0000) Subject: Revert "Limit searches at 500 per page" X-Git-Tag: 1.31.0-rc.0~16951^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=e56e3ce5e9273def9abbeebbccc79ed1d5bd7ffa;p=lhc%2Fweb%2Fwiklou.git Revert "Limit searches at 500 per page" People seem to like large slow search pages. This reverts commit 42d4f35696852b2d72089dce86034792fdf4de8e. Change-Id: I52ee602a81c1b6ec4e124008806271b0c74c581c --- diff --git a/includes/WebRequest.php b/includes/WebRequest.php index b3dda75b23..2a7c032593 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -795,12 +795,11 @@ class WebRequest { * defaults if not given. The limit must be positive and is capped at 5000. * Offset must be positive but is not capped. * - * @param int $deflimit limit to use if no input and the user hasn't set the option. + * @param $deflimit Integer: limit to use if no input and the user hasn't set the option. * @param string $optionname to specify an option other than rclimit to pull from. - * @param int $hardlimit the maximum upper limit to allow, usually 5000 * @return array first element is limit, second is offset */ - public function getLimitOffset( $deflimit = 50, $optionname = 'rclimit', $hardlimit = 5000 ) { + public function getLimitOffset( $deflimit = 50, $optionname = 'rclimit' ) { global $wgUser; $limit = $this->getInt( 'limit', 0 ); @@ -813,8 +812,8 @@ class WebRequest { if ( $limit <= 0 ) { $limit = $deflimit; } - if ( $limit > $hardlimit ) { - $limit = $hardlimit; # We have *some* limits... + if ( $limit > 5000 ) { + $limit = 5000; # We have *some* limits... } $offset = $this->getInt( 'offset', 0 ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 98ae6f51cd..e4ca057057 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -120,7 +120,7 @@ class SpecialSearch extends SpecialPage { */ public function load() { $request = $this->getRequest(); - list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, '', 500 ); + list( $this->limit, $this->offset ) = $request->getLimitOffset( 20 ); $this->mPrefix = $request->getVal( 'prefix', '' ); $user = $this->getUser();