From 7282f1a3417507460888751ca8f354807cf31a43 Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Wed, 5 Dec 2007 06:32:17 +0000 Subject: [PATCH] API: Standardize limits. Use ApiBase constants to avoid similar breakage and inconsistencies in the future. --- includes/api/ApiQueryDeletedrevs.php | 4 ++-- includes/api/ApiQueryRevisions.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 39ae80803e..c37f46c7d9 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -83,8 +83,8 @@ class ApiQueryDeletedrevs extends ApiQueryBase { // This also means stricter limits and stricter restrictions if(!$wgUser->isAllowed('undelete')) $this->dieUsage('You don\'t have permission to view deleted revision content', 'permissiondenied'); - $userMax = 50; - $botMax = 200; + $userMax = ApiBase :: LIMIT_SML1; + $botMax = ApiBase :: LIMIT_SML2; $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax); } if($fld_token) diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 1c14c8770b..d5a108d4c8 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -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) { -- 2.20.1