Fixed nested filters

This commit is contained in:
Madpwnhammer 2022-08-09 15:41:53 +03:00
parent ba85357dba
commit 5102381ac5
1 changed files with 3 additions and 3 deletions

View File

@ -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'");