From 3cb5a4f8582eb1347b51c6cb2497fc0fb344115f Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Thu, 20 Mar 2008 16:28:38 +0000 Subject: [PATCH] Handle empty sets correctly --- includes/api/ApiBase.php | 2 ++ 1 file changed, 2 insertions(+) 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) . "'" : ''; -- 2.20.1