From 5f03fdf6213f46e0e87fba0f9f8ce0f0aa7e99d0 Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Thu, 28 Feb 2008 17:25:33 +0000 Subject: [PATCH] API: Couplt problems with ApiQueryDeletedRevs * $limit undefined, was doing limit checking against null * Bring limit=max behavior in line with r31258 --- includes/api/ApiQueryDeletedrevs.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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(); -- 2.20.1