From 96f4d7a855a751b14a36bb0c0e78c88db033d169 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 1 Sep 2013 10:00:00 +0000 Subject: key_not_exists: handle empty array --- plugins/modifier.key_not_exists.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/modifier.key_not_exists.php b/plugins/modifier.key_not_exists.php index f6906cd..f29e077 100644 --- a/plugins/modifier.key_not_exists.php +++ b/plugins/modifier.key_not_exists.php @@ -2,6 +2,10 @@ function smarty_modifier_key_not_exists($value, $key) { + if (!is_array($value)) { + return array(); + } + return array_filter($value, function($v) use ($key) { return !array_key_exists($key, $v); -- cgit v1.2.3-1-g7c22