From: Victor Vasiliev Date: Thu, 20 Mar 2008 16:28:38 +0000 (+0000) Subject: Handle empty sets correctly X-Git-Tag: 1.31.0-rc.0~48936 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=3cb5a4f8582eb1347b51c6cb2497fc0fb344115f;p=lhc%2Fweb%2Fwiklou.git Handle empty sets correctly --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 5551b01e56..cc88e97320 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -503,6 +503,8 @@ abstract class ApiBase { * @return (allowMultiple ? an_array_of_values : a_single_value) */ protected function parseMultiValue($valueName, $value, $allowMultiple, $allowedValues) { + if( !trim( $value ) ) + return array(); $valuesList = explode('|', $value); if (!$allowMultiple && count($valuesList) != 1) { $possibleValues = is_array($allowedValues) ? "of '" . implode("', '", $allowedValues) . "'" : '';