Skip to content

Commit

Permalink
update access to parent object
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Tews committed Apr 19, 2018
1 parent 8bea607 commit fbbb292
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libs/sysplugins/smarty_internal_method_gettemplatevars.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function getTemplateVars(Smarty_Internal_Data $data, $varName = null, Sma
}
}
// not found, try at parent
if ($searchParents) {
if ($searchParents && isset($_ptr->parent)) {
$_ptr = $_ptr->parent;
} else {
$_ptr = null;
Expand Down Expand Up @@ -93,7 +93,7 @@ public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Intern
return $_ptr->tpl_vars[ $varName ];
}
// not found, try at parent
if ($searchParents) {
if ($searchParents && isset($_ptr->parent)) {
$_ptr = $_ptr->parent;
} else {
$_ptr = null;
Expand All @@ -103,14 +103,11 @@ public function _getVariable(Smarty_Internal_Data $data, $varName, Smarty_Intern
// 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;
}

}

0 comments on commit fbbb292

Please sign in to comment.