From b76e7e0db090fde43a82699437fe35dc07481f0b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 3 May 2008 04:17:03 +0000 Subject: [PATCH] Put some upper limit here --- includes/api/ApiBase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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"); -- 2.20.1