r28176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28175‎ | r28176 | r28177 >
Date:06:32, 5 December 2007
Author:amidaniel
Status:old
Tags:
Comment:
API: Standardize limits. Use ApiBase constants to avoid similar breakage and inconsistencies in the future.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryDeletedrevs.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryDeletedrevs.php
@@ -83,8 +83,8 @@
8484 // This also means stricter limits and stricter restrictions
8585 if(!$wgUser->isAllowed('undelete'))
8686 $this->dieUsage('You don\'t have permission to view deleted revision content', 'permissiondenied');
87 - $userMax = 50;
88 - $botMax = 200;
 87+ $userMax = ApiBase :: LIMIT_SML1;
 88+ $botMax = ApiBase :: LIMIT_SML2;
8989 $this->validateLimit('limit', $params['limit'], 1, $userMax, $botMax);
9090 }
9191 if($fld_token)
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -119,8 +119,8 @@
120120 $this->expandTemplates = $expandtemplates;
121121 }
122122
123 - $userMax = ($this->fld_content ? 50 : 500);
124 - $botMax = ($this->fld_content ? 200 : 10000);
 123+ $userMax = ( $this->fld_content ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
 124+ $botMax = ( $this->fld_content ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
125125
126126 if ($enumRevMode) {
127127

Status & tagging log