From b6e6b675483e2d652e9b89b5b38314cf8eab41b7 Mon Sep 17 00:00:00 2001 From: rodneyrehm Date: Tue, 27 Sep 2011 10:09:25 +0000 Subject: [PATCH] - bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34) --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_compile_section.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index e3487567..381aa8d7 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +27.09.2011 +- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34) + 26.09.2011 - bugfix repeated calls to same subtemplate did not make use of cached template object diff --git a/libs/sysplugins/smarty_internal_compile_section.php b/libs/sysplugins/smarty_internal_compile_section.php index fda307a3..ccb7673d 100644 --- a/libs/sysplugins/smarty_internal_compile_section.php +++ b/libs/sysplugins/smarty_internal_compile_section.php @@ -59,7 +59,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { $section_name = $_attr['name']; - $output .= "unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n"; + $output .= "if (isset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name])) unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n"; $section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]"; foreach ($_attr as $attr_name => $attr_value) {