- 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
This commit is contained in:
uwetews
2016-09-27 23:19:56 +02:00
parent efa18457f2
commit 3f0d519daf
2 changed files with 6 additions and 1 deletions

View File

@@ -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

View File

@@ -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);