diff options
| author | uwetews <uwe.tews@googlemail.com> | 2016-10-23 18:48:17 +0200 |
|---|---|---|
| committer | uwetews <uwe.tews@googlemail.com> | 2016-10-23 18:48:17 +0200 |
| commit | 98efe22e02bab7e363c1089ff2f3faffe6b30f21 (patch) | |
| tree | 09665d8224b6f21a14cada966eec3183f529d6d1 | |
| parent | d79edd2fe0b4439502b6bf0646e0e89d9e567f3a (diff) | |
| download | smarty-98efe22e02bab7e363c1089ff2f3faffe6b30f21.tar.gz smarty-98efe22e02bab7e363c1089ff2f3faffe6b30f21.tar.bz2 smarty-98efe22e02bab7e363c1089ff2f3faffe6b30f21.zip | |
- improvement/bugfix when Smarty::fetch() is called on a template object the inheritance and tplFunctions property
should be copied to the called template object
| -rw-r--r-- | libs/sysplugins/smarty_internal_templatebase.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php index bdc184ac..6a97bc4d 100644 --- a/libs/sysplugins/smarty_internal_templatebase.php +++ b/libs/sysplugins/smarty_internal_templatebase.php @@ -169,7 +169,14 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data if ($this->_objType == 1) { // set caching in template object $template->caching = $this->caching; - } else { + } + } + // fetch template content + $level = ob_get_level(); + try { + $_smarty_old_error_level = + isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null; + if ($this->_objType == 2) { /* @var Smarty_Internal_Template $this */ $template->tplFunctions = $this->tplFunctions; $template->inheritance = $this->inheritance; @@ -178,12 +185,6 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data if (isset($parent->_objType) && ($parent->_objType == 2) && !empty($parent->tplFunctions)) { $template->tplFunctions = array_merge($parent->tplFunctions, $template->tplFunctions); } - } - // fetch template content - $level = ob_get_level(); - try { - $_smarty_old_error_level = - isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null; if ($function == 2) { if ($template->caching) { // return cache status of template |
