diff --git a/change_log.txt b/change_log.txt index 9c6f8dd7..7137e427 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== 3.1.31-dev ===== (xx.xx.xx) + 27.09.2016 + - bugfix when Smarty does use an internally cached template object on Smarty::fetch() calls + the template and config variables must be cleared https://github.com/smarty-php/smarty/issues/297 + 20.09.2016 - bugfix some $smarty special template variables are no longer accessed as real variable. using them on calls like {if isset($smarty.foo)} or {if empty($smarty.foo)} will fail diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6f7937fa..21015fc8 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.31-dev/29'; + const SMARTY_VERSION = '3.1.31-dev/30'; /** * define variable scopes @@ -1120,6 +1120,7 @@ class Smarty extends Smarty_Internal_TemplateBase $tpl->tpl_vars = $tpl->config_vars = array(); } else if (!$do_clone && isset($this->_cache[ 'tplObjects' ][ $_templateId ])) { $tpl = clone $this->_cache[ 'tplObjects' ][ $_templateId ]; + $tpl->tpl_vars = $tpl->config_vars = array(); } else { /* @var Smarty_Internal_Template $tpl */ $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null);