r77697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77696‎ | r77697 | r77698 >
Date:00:36, 4 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Followup r77666, bug 26219

Only add the message about multi value, if the type is not an array, or if it is an array, if it has over 50 (LIMIT_SML1) items
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiBase.php
@@ -368,8 +368,13 @@
369369 }
370370
371371 if ( isset( $paramSettings[self::PARAM_ISMULTI] ) ) {
372 - $desc .= $paramPrefix . "Maximum number of values " .
 372+ $isArray = is_array( $paramSettings[self::PARAM_TYPE] );
 373+
 374+ if ( !$isArray
 375+ || $isArray && count( $paramSettings[self::PARAM_TYPE] ) > self::LIMIT_SML1) {
 376+ $desc .= $paramPrefix . "Maximum number of values " .
373377 self::LIMIT_SML1 . " (" . self::LIMIT_SML2 . " for bots)";
 378+ }
374379 }
375380 }
376381 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77666* (bug 26219) Show API limits for multi values in description...reedy16:24, 3 December 2010

Status & tagging log