API: Couplt problems with ApiQueryDeletedRevs
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Thu, 28 Feb 2008 17:25:33 +0000 (17:25 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Thu, 28 Feb 2008 17:25:33 +0000 (17:25 +0000)
* $limit undefined, was doing limit checking against null
* Bring limit=max behavior in line with r31258

includes/api/ApiQueryDeletedrevs.php

index a8c8f65..76e6eb1 100644 (file)
@@ -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();