- bugfix repeated calls to same subtemplate did not make use of cached template object

This commit is contained in:
uwe.tews@googlemail.com
2011-09-26 15:21:50 +00:00
parent a98d83bbf3
commit 709e5e1e84
2 changed files with 4 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
===== trunk ===== ===== trunk =====
26.09.2011
- bugfix repeated calls to same subtemplate did not make use of cached template object
24.09.2011 24.09.2011
- removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application - removed internal muteExpectedErrors() calls in favor of having the implementor call this once from his application
- optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable - optimized muteExpectedErrors() to pass errors to the latest registered error handler, if appliccable

View File

@@ -240,7 +240,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope) public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope)
{ {
// already in template cache? // already in template cache?
$_templateId = sha1($template . $cache_id . $compile_id); $_templateId = sha1(join(DIRECTORY_SEPARATOR, $this->smarty->getTemplateDir()).$template . $cache_id . $compile_id);
if (isset($this->smarty->template_objects[$_templateId])) { if (isset($this->smarty->template_objects[$_templateId])) {
// clone cached template object because of possible recursive call // clone cached template object because of possible recursive call
$tpl = clone $this->smarty->template_objects[$_templateId]; $tpl = clone $this->smarty->template_objects[$_templateId];