From: Daniel Cannon Date: Thu, 28 Feb 2008 17:25:33 +0000 (+0000) Subject: API: Couplt problems with ApiQueryDeletedRevs X-Git-Tag: 1.31.0-rc.0~49308 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=5f03fdf6213f46e0e87fba0f9f8ce0f0aa7e99d0;p=lhc%2Fweb%2Fwiklou.git API: Couplt problems with ApiQueryDeletedRevs * $limit undefined, was doing limit checking against null * Bring limit=max behavior in line with r31258 --- diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index a8c8f65946..76e6eb19bc 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -87,11 +87,16 @@ class ApiQueryDeletedrevs extends ApiQueryBase { // Check limits $userMax = $fld_content ? ApiBase :: LIMIT_SML1 : ApiBase :: LIMIT_BIG1; $botMax = $fld_content ? ApiBase :: LIMIT_SML2 : ApiBase :: LIMIT_BIG2; + + $limit = $params['limit']; + if( $limit == 'max' ) { $limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax; - $this->getResult()->addValue( 'limits', 'limit', $limit ); + $this->getResult()->addValue( 'limits', $this->getModuleName(), $limit ); } - $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax); + + $this->validateLimit('limit', $limit, 1, $userMax, $botMax); + if($fld_token) // Undelete tokens are identical for all pages, so we cache one here $token = $wgUser->editToken();