From: Bryan Tong Minh Date: Fri, 29 Aug 2008 21:49:36 +0000 (+0000) Subject: Fix for my previous commit: Filter out null values X-Git-Tag: 1.31.0-rc.0~45553 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=a66bffaedfece7b94e212908cfcc462ed20edc64;p=lhc%2Fweb%2Fwiklou.git Fix for my previous commit: Filter out null values --- diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 42538226cc..ae78e19ffc 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -373,7 +373,9 @@ abstract class ApiBase { $required = func_get_args(); array_shift($required); - $intersection = array_intersect(array_keys($params), $required); + $intersection = array_intersect(array_keys(array_filter($params, + create_function('$x', 'return !is_null($x);') + )), $required); if (count($intersection) > 1) { $this->dieUsage('The parameters '.implode(', ', $intersection).' can not be used together', 'invalidparammix'); } elseif (count($intersection) == 0) {