From a66bffaedfece7b94e212908cfcc462ed20edc64 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Fri, 29 Aug 2008 21:49:36 +0000 Subject: [PATCH] Fix for my previous commit: Filter out null values --- includes/api/ApiBase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.20.1