try catch missing vars
authorAlan <alan@roojs.com>
Wed, 23 Aug 2023 04:50:34 +0000 (12:50 +0800)
committerAlan <alan@roojs.com>
Wed, 23 Aug 2023 04:50:34 +0000 (12:50 +0800)
HTML/Template/Flexy/Compiler/Flexy.php

index 46eda02..6e41a6a 100644 (file)
@@ -461,7 +461,8 @@ class HTML_Template_Flexy_Compiler_Flexy extends HTML_Template_Flexy_Compiler {
             return $loopon;
         }
         
-        $ret = 'if ($this->options[\'strict\'] || ('.
+        $ret = 'if (isset('.$loopon .') && ( ' .
+            '$this->options[\'strict\'] || ' .
             'is_array('. $loopon. ')  || ' .
             'is_object(' . $loopon  . '))) ' .
             'foreach(' . $loopon  . " ";