From fbbb292ef051644dd6cd81231531249ca2c10d18 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 19 Apr 2018 16:04:41 +0200 Subject: [PATCH] update access to parent object --- .../smarty_internal_method_gettemplatevars.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/sysplugins/smarty_internal_method_gettemplatevars.php b/libs/sysplugins/smarty_internal_method_gettemplatevars.php index 1759646f..510bab0f 100644 --- a/libs/sysplugins/smarty_internal_method_gettemplatevars.php +++ b/libs/sysplugins/smarty_internal_method_gettemplatevars.php @@ -53,7 +53,7 @@ class Smarty_Internal_Method_GetTemplateVars } } // not found, try at parent - if ($searchParents) { + if ($searchParents && isset($_ptr->parent)) { $_ptr = $_ptr->parent; } else { $_ptr = null; @@ -93,7 +93,7 @@ class Smarty_Internal_Method_GetTemplateVars return $_ptr->tpl_vars[ $varName ]; } // not found, try at parent - if ($searchParents) { + if ($searchParents && isset($_ptr->parent)) { $_ptr = $_ptr->parent; } else { $_ptr = null; @@ -103,14 +103,11 @@ class Smarty_Internal_Method_GetTemplateVars // found it, return it return Smarty::$global_tpl_vars[ $varName ]; } - /* @var \Smarty $smarty */ - $smarty = isset($data->smarty) ? $data->smarty : $data; - if ($smarty->error_unassigned && $errorEnable) { + if ($errorEnable && $data->_getSmartyObj()->error_unassigned) { // force a notice $x = $$varName; } return new Smarty_Undefined_Variable; } - } \ No newline at end of file