Skip to content

Commit

Permalink
- bugfix when Smarty is using a cached template object on Smarty::fet…
Browse files Browse the repository at this point in the history
…ch() or Smarty::isCached() the inheritance data

    must be removed #312
  • Loading branch information
uwetews committed Nov 11, 2016
1 parent e867ae1 commit d120c1f
Show file tree
Hide file tree
Showing 2 changed files with 8 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)
11.11.2016
- bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data
must be removed https://github.com/smarty-php/smarty/issues/312

08.11.2016
- add bootstrap file to load and register Smarty_Autoloader. Change composer.json to make it known to composer

Expand Down
5 changes: 4 additions & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.31-dev/42';
const SMARTY_VERSION = '3.1.31-dev/43';

/**
* define variable scopes
Expand Down Expand Up @@ -434,6 +434,7 @@ class Smarty extends Smarty_Internal_TemplateBase
* @var boolean
*/
public $extends_recursion = true;

/**
* force cache file creation
*
Expand Down Expand Up @@ -1119,9 +1120,11 @@ public function createTemplate($template, $cache_id = null, $compile_id = null,
if ($this->caching && isset($this->_cache[ 'isCached' ][ $_templateId ])) {
$tpl = $do_clone ? clone $this->_cache[ 'isCached' ][ $_templateId ] :
$this->_cache[ 'isCached' ][ $_templateId ];
$tpl->inheritance = null;
$tpl->tpl_vars = $tpl->config_vars = array();
} else if (!$do_clone && isset($this->_cache[ 'tplObjects' ][ $_templateId ])) {
$tpl = clone $this->_cache[ 'tplObjects' ][ $_templateId ];
$tpl->inheritance = null;
$tpl->tpl_vars = $tpl->config_vars = array();
} else {
/* @var Smarty_Internal_Template $tpl */
Expand Down

0 comments on commit d120c1f

Please sign in to comment.