From 5102381ac555ca2249caaff6461f3f385d002a4c Mon Sep 17 00:00:00 2001 From: Madpwnhammer Date: Tue, 9 Aug 2022 15:41:53 +0300 Subject: [PATCH] Fixed nested filters --- targets/php/php.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/php/php.inc.php b/targets/php/php.inc.php index b74bde6..96fee31 100644 --- a/targets/php/php.inc.php +++ b/targets/php/php.inc.php @@ -340,10 +340,10 @@ class mtgPHPCodegen extends mtgCodegen if(!is_array($args)) throw new Exception("Bad filter args: $args_json"); } - if ($add_assoc_check) - return "\$assoc ? $filter_func($val, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ") : $val"; + if($add_assoc_check) + $str = "(\$assoc ? $filter_func($str, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ") : $str)"; else - return "$filter_func($val, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ")"; + $str = "$filter_func($str, '$field_name', \$this, " . str_replace("\n", "", var_export($args, true)) . ")"; } else throw new Exception("No such filter '$filter_func'");