diff options
Diffstat (limited to 'plugins/modifier.key_not_exists.php')
-rw-r--r-- | plugins/modifier.key_not_exists.php | 4 |
1 files changed, 4 insertions, 0 deletions
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); |