mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
update access to parent object
This commit is contained in:
@@ -53,7 +53,7 @@ class Smarty_Internal_Method_GetTemplateVars
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// not found, try at parent
|
// not found, try at parent
|
||||||
if ($searchParents) {
|
if ($searchParents && isset($_ptr->parent)) {
|
||||||
$_ptr = $_ptr->parent;
|
$_ptr = $_ptr->parent;
|
||||||
} else {
|
} else {
|
||||||
$_ptr = null;
|
$_ptr = null;
|
||||||
@@ -93,7 +93,7 @@ class Smarty_Internal_Method_GetTemplateVars
|
|||||||
return $_ptr->tpl_vars[ $varName ];
|
return $_ptr->tpl_vars[ $varName ];
|
||||||
}
|
}
|
||||||
// not found, try at parent
|
// not found, try at parent
|
||||||
if ($searchParents) {
|
if ($searchParents && isset($_ptr->parent)) {
|
||||||
$_ptr = $_ptr->parent;
|
$_ptr = $_ptr->parent;
|
||||||
} else {
|
} else {
|
||||||
$_ptr = null;
|
$_ptr = null;
|
||||||
@@ -103,14 +103,11 @@ class Smarty_Internal_Method_GetTemplateVars
|
|||||||
// found it, return it
|
// found it, return it
|
||||||
return Smarty::$global_tpl_vars[ $varName ];
|
return Smarty::$global_tpl_vars[ $varName ];
|
||||||
}
|
}
|
||||||
/* @var \Smarty $smarty */
|
if ($errorEnable && $data->_getSmartyObj()->error_unassigned) {
|
||||||
$smarty = isset($data->smarty) ? $data->smarty : $data;
|
|
||||||
if ($smarty->error_unassigned && $errorEnable) {
|
|
||||||
// force a notice
|
// force a notice
|
||||||
$x = $$varName;
|
$x = $$varName;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Smarty_Undefined_Variable;
|
return new Smarty_Undefined_Variable;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user