- bugfix on nocache attribute at {assign} and {append}

This commit is contained in:
Uwe.Tews
2010-07-31 13:29:59 +00:00
parent b52cbe9adb
commit e8fbee624d
4 changed files with 23 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
31/07/2010
- bugfix on nocache attribute at {assign} and {append}
30/07/2010
- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}

View File

@@ -32,14 +32,20 @@ class Smarty_Internal_Compile_Append extends Smarty_Internal_CompileBase {
// it shall not controll caching of the compiled code, but is a parameter
if (isset($args['nocache'])) {
if ($args['nocache'] == 'true') {
$_nocache = 'true';
$_nocache_boolean = true;
$this->compiler->tag_nocache = true;
}
unset($args['nocache']);
}
// check and get attributes
$_attr = $this->_get_attributes($args);
if ($this->compiler->tag_nocache) {
$_nocache = 'true';
// create nocache var to make it know for further compiling
$compiler->template->tpl_vars[trim($_attr['var'],"'")] = new Smarty_variable(null, true);
}
if (isset($_attr['scope'])) {
$_attr['scope'] = trim($_attr['scope'], "'\"");
if ($_attr['scope'] == 'parent') {

View File

@@ -32,14 +32,20 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
// it shall not controll caching of the compiled code, but is a parameter
if (isset($args['nocache'])) {
if ($args['nocache'] == 'true') {
$_nocache = 'true';
$_nocache_boolean = true;
$this->compiler->tag_nocache = true;
}
unset($args['nocache']);
}
// check and get attributes
$_attr = $this->_get_attributes($args);
if ($this->compiler->tag_nocache) {
$_nocache = 'true';
// create nocache var to make it know for further compiling
$compiler->template->tpl_vars[trim($_attr['var'],"'")] = new Smarty_variable(null, true);
}
if (isset($_attr['scope'])) {
$_attr['scope'] = trim($_attr['scope'], "'\"");
if ($_attr['scope'] == 'parent') {

View File

@@ -375,7 +375,8 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
}
$this->cacheFileChecked = true;
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] >= 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
$this->rendered_content = null;
$this->tpl_vars = array();
$this->rendered_content = null;
return $this->isCached;
}
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
@@ -389,6 +390,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
}
// If ($mtime > $this->getCachedTimestamp()) {
If ($mtime > $_file_to_check[1]) {
$this->tpl_vars = array();
$this->rendered_content = null;
return $this->isCached;
}