diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2013-09-01 10:00:00 +0000 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2013-09-01 10:00:00 +0000 |
commit | 96f4d7a855a751b14a36bb0c0e78c88db033d169 (patch) | |
tree | 63eae3cd5c03a914b35c260820ad5d11a3f21642 | |
parent | beb6a8fdfe13b4e884156a538b006af5b89842e1 (diff) | |
download | dokuwiki-96f4d7a855a751b14a36bb0c0e78c88db033d169.tar.gz dokuwiki-96f4d7a855a751b14a36bb0c0e78c88db033d169.tar.bz2 dokuwiki-96f4d7a855a751b14a36bb0c0e78c88db033d169.zip |
key_not_exists: handle empty array
-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); |