Skip to content

Commit

Permalink
- bugfix when Smarty does use an internally cached template object on…
Browse files Browse the repository at this point in the history
… Smarty::fetch() calls

           the template and config variables must be cleared #297
  • Loading branch information
uwetews committed Sep 27, 2016
1 parent efa1845 commit 3f0d519
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1120,6 +1120,7 @@ public function createTemplate($template, $cache_id = null, $compile_id = null,
$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);
Expand Down

0 comments on commit 3f0d519

Please sign in to comment.