From 34763ae316e2a32defe9beef96769e10c605f9c0 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Mon, 27 Jan 2020 17:54:45 +0100 Subject: [PATCH] This appears to fix #453, #498, #499 and possibly more issues. Will need further testing and unit tests. --- .../smarty_internal_templatecompilerbase.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index a72f3a4a..a376ecc6 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -627,16 +627,8 @@ abstract class Smarty_Internal_TemplateCompilerBase if (count($parameter) === 0) { $this->trigger_template_error('Illegal number of parameter in "isset()"'); } - if ($parHasFuction) { - $pa = array(); - foreach ($parameter as $p) { - $pa[] = (strpos($p, '(') === false) ? ('isset(' . $p . ')') : ('(' . $p . ' !== null )'); - } - return '(' . implode(' && ', $pa) . ')'; - } else { - $isset_par = str_replace("')->value", "',null,true,false)->value", $par); - } - return $name . '(' . $isset_par . ')'; + $isset_par = str_replace("')->value", "',null,true,false)->value", $par); + return '@!is_null(' . $isset_par . ')'; } elseif (in_array( $func_name, array(