diff options
author | Mario <mario@mariovavti.com> | 2022-07-26 18:00:00 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-07-26 18:00:00 +0000 |
commit | 40377796edd8c612ce9d68f52fc146ad32302f9e (patch) | |
tree | 92cce4a3ee3627ed28f45ce8f0bb3598be87c8c9 /Zotlabs/Render/Comanche.php | |
parent | c452a621fe7db5405d929ebc5f5433c9670fc367 (diff) | |
parent | fedad7f31a1b9133bfd63de7fc19de6916485254 (diff) | |
download | volse-hubzilla-7.6.tar.gz volse-hubzilla-7.6.tar.bz2 volse-hubzilla-7.6.zip |
Merge branch '7.6RC'7.6
Diffstat (limited to 'Zotlabs/Render/Comanche.php')
-rw-r--r-- | Zotlabs/Render/Comanche.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 230c2455e..7288c7fd7 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -219,7 +219,8 @@ class Comanche { * - [if $config.system.foo {} baz] which will check if 'baz' is an array element in get_config('system','foo') * - [if $config.system.foo {*} baz] which will check if 'baz' is an array key in get_config('system','foo') * - [if $config.system.foo] which will check for a return of a true condition for get_config('system','foo'); - * + * - [if !$config.system.foo] which will check for a return of a false condition for get_config('system','foo'); + * * The values 0, '', an empty array, and an unset value will all evaluate to false. * * @param int|string $s @@ -299,6 +300,15 @@ class Comanche { return false; } + // Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important. + if (preg_match('/[\!\$](.*?)$/', $s, $matches)) { + $x = $this->get_condition_var($matches[1]); + if (!$x) { + return true; + } + return false; + } + if(preg_match('/[\$](.*?)$/',$s,$matches)) { $x = $this->get_condition_var($matches[1]); if($x) |