are now listed on action=help
* (bug 15044) Added requestid parameter to api.php to facilitate distinguishing
between requests
+* (bug 15048) Added limit field for multivalue parameters to action=paraminfo
+ output.
+* When the limit on multivalue parameters is exceeded, a warning is issued
=== Languages updated in 1.14 ===
protected function parseMultiValue($valueName, $value, $allowMultiple, $allowedValues) {
if( trim($value) === "" )
return array();
- $sizeLimit = $this->mMainModule->canApiHighLimits() ? 501 : 51;
- $valuesList = explode('|', $value,$sizeLimit);
- if( count($valuesList) == $sizeLimit ) {
+ $sizeLimit = $this->mMainModule->canApiHighLimits() ? self::LIMIT_SML2 : self::LIMIT_SML1;
+ $valuesList = explode('|', $value, $sizeLimit + 1);
+ if( count($valuesList) == $sizeLimit + 1 ) {
$junk = array_pop($valuesList); // kill last jumbled param
+ // Set a warning too
+ $this->setWarning("Too many values supplied for parameter '$valueName': the limit is $sizeLimit");
}
if (!$allowMultiple && count($valuesList) != 1) {
$possibleValues = is_array($allowedValues) ? "of '" . implode("', '", $allowedValues) . "'" : '';
'params' => array()
),
'apihighlimits' => array(
- 'msg' => 'Use higher limits in API queries (Slow queries: $1 results; Fast queries: $2 results). These limits also apply to multivalue parameters.',
+ 'msg' => 'Use higher limits in API queries (Slow queries: $1 results; Fast queries: $2 results). The limits for slow queries also apply to multivalue parameters.',
'params' => array (ApiMain::LIMIT_SML2, ApiMain::LIMIT_BIG2)
)
);
$a['default'] = $p[ApiBase::PARAM_DFLT];
if(isset($p[ApiBase::PARAM_ISMULTI]))
if($p[ApiBase::PARAM_ISMULTI])
+ {
$a['multi'] = '';
+ $a['limit'] = $this->getMain()->canApiHighLimits() ?
+ ApiBase::LIMIT_SML2 :
+ ApiBase::LIMIT_SML1;
+ }
if(isset($p[ApiBase::PARAM_TYPE]))
{
$a['type'] = $p[ApiBase::PARAM_TYPE];