From: Aaron Schulz Date: Sat, 3 May 2008 04:17:03 +0000 (+0000) Subject: Put some upper limit here X-Git-Tag: 1.31.0-rc.0~47937 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=b76e7e0db090fde43a82699437fe35dc07481f0b;p=lhc%2Fweb%2Fwiklou.git Put some upper limit here --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index d8bea668a5..0b496b90e0 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -508,7 +508,10 @@ abstract class ApiBase { protected function parseMultiValue($valueName, $value, $allowMultiple, $allowedValues) { if( trim($value) === "" ) return array(); - $valuesList = explode('|', $value); + $valuesList = explode('|', $value,51); // some kind of limit is needed here! + if( count($valuesList) == 51 ) { + $junk = array_pop($valuesList); // kill last jumbled param + } if (!$allowMultiple && count($valuesList) != 1) { $possibleValues = is_array($allowedValues) ? "of '" . implode("', '", $allowedValues) . "'" : ''; $this->dieUsage("Only one $possibleValues is allowed for parameter '$valueName'", "multival_$valueName");