diff options
| author | rodneyrehm <rodneyrehm@localhost> | 2011-09-27 10:09:25 +0000 |
|---|---|---|
| committer | rodneyrehm <rodneyrehm@localhost> | 2011-09-27 10:09:25 +0000 |
| commit | b6e6b675483e2d652e9b89b5b38314cf8eab41b7 (patch) | |
| tree | e594b902e1f81414d0dc4b4ffd8e7bf603daf66b | |
| parent | 709e5e1e84f5a1c2cc6c33e10b98eb00ea8aaf8e (diff) | |
| download | smarty-b6e6b675483e2d652e9b89b5b38314cf8eab41b7.tar.gz smarty-b6e6b675483e2d652e9b89b5b38314cf8eab41b7.tar.bz2 smarty-b6e6b675483e2d652e9b89b5b38314cf8eab41b7.zip | |
- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34)
| -rw-r--r-- | change_log.txt | 3 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_section.php | 2 |
2 files changed, 4 insertions, 1 deletions
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) { |
