From df541858defb0fd0010659a5fea59b5ed01e5a92 Mon Sep 17 00:00:00 2001 From: uwetews Date: Wed, 19 Aug 2015 01:22:27 +0200 Subject: [PATCH] - cache template object of {include} if same template is included several times --- libs/sysplugins/smarty_internal_template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index a4c2495d..62c394dc 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -569,6 +569,9 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase $tpl = $this->setupSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope, $cache_tpl_obj); if (!isset($tpl->compiled)) { $tpl->compiled = $this->compiled; + if ($tpl->compiled->includes[$tpl->source->type . ':' . $tpl->source->name] > 1) { + $tpl->smarty->template_objects[$tpl->templateId] = $tpl; + } } if ($this->smarty->debugging) { $this->smarty->_debug->start_template($tpl);