API: Standardize limits. Use ApiBase constants to avoid similar breakage and inconsis...
authorDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 5 Dec 2007 06:32:17 +0000 (06:32 +0000)
committerDaniel Cannon <amidaniel@users.mediawiki.org>
Wed, 5 Dec 2007 06:32:17 +0000 (06:32 +0000)
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryRevisions.php

index 39ae808..c37f46c 100644 (file)
@@ -83,8 +83,8 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
                        // This also means stricter limits and stricter restrictions\r
                        if(!$wgUser->isAllowed('undelete'))\r
                                $this->dieUsage('You don\'t have permission to view deleted revision content', 'permissiondenied');\r
-                       $userMax = 50;\r
-                       $botMax = 200;\r
+                       $userMax = ApiBase :: LIMIT_SML1;\r
+                       $botMax  = ApiBase :: LIMIT_SML2;\r
                        $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax);\r
                }\r
                if($fld_token)\r
index 1c14c87..d5a108d 100644 (file)
@@ -119,8 +119,8 @@ class ApiQueryRevisions extends ApiQueryBase {
                        $this->expandTemplates = $expandtemplates;
                }
 
-               $userMax = ($this->fld_content ? 50 : 500);
-               $botMax = ($this->fld_content ? 200 : 10000);
+               $userMax = ( $this->fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
+               $botMax  = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
 
                if ($enumRevMode) {