mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
- bugfix on nocache attribute at {assign} and {append}
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
31/07/2010
|
||||||
|
- bugfix on nocache attribute at {assign} and {append}
|
||||||
|
|
||||||
30/07/2010
|
30/07/2010
|
||||||
- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}
|
- bugfix passing scope attributes in doublequoted strings did not work at {include} {assign} and {append}
|
||||||
|
|
||||||
|
@@ -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
|
// it shall not controll caching of the compiled code, but is a parameter
|
||||||
if (isset($args['nocache'])) {
|
if (isset($args['nocache'])) {
|
||||||
if ($args['nocache'] == 'true') {
|
if ($args['nocache'] == 'true') {
|
||||||
$_nocache = 'true';
|
$this->compiler->tag_nocache = true;
|
||||||
$_nocache_boolean = true;
|
|
||||||
}
|
}
|
||||||
unset($args['nocache']);
|
unset($args['nocache']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->_get_attributes($args);
|
$_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'])) {
|
if (isset($_attr['scope'])) {
|
||||||
$_attr['scope'] = trim($_attr['scope'], "'\"");
|
$_attr['scope'] = trim($_attr['scope'], "'\"");
|
||||||
if ($_attr['scope'] == 'parent') {
|
if ($_attr['scope'] == 'parent') {
|
||||||
|
@@ -24,7 +24,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
|
|||||||
{
|
{
|
||||||
$this->compiler = $compiler;
|
$this->compiler = $compiler;
|
||||||
$this->required_attributes = array('var', 'value');
|
$this->required_attributes = array('var', 'value');
|
||||||
$this->optional_attributes = array('scope', 'nocache', 'smarty_internal_index');
|
$this->optional_attributes = array('scope', 'nocache', 'smarty_internal_index');
|
||||||
|
|
||||||
$_nocache = 'null';
|
$_nocache = 'null';
|
||||||
$_scope = 'null';
|
$_scope = 'null';
|
||||||
@@ -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
|
// it shall not controll caching of the compiled code, but is a parameter
|
||||||
if (isset($args['nocache'])) {
|
if (isset($args['nocache'])) {
|
||||||
if ($args['nocache'] == 'true') {
|
if ($args['nocache'] == 'true') {
|
||||||
$_nocache = 'true';
|
$this->compiler->tag_nocache = true;
|
||||||
$_nocache_boolean = true;
|
|
||||||
}
|
}
|
||||||
unset($args['nocache']);
|
unset($args['nocache']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check and get attributes
|
// check and get attributes
|
||||||
$_attr = $this->_get_attributes($args);
|
$_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'])) {
|
if (isset($_attr['scope'])) {
|
||||||
$_attr['scope'] = trim($_attr['scope'], "'\"");
|
$_attr['scope'] = trim($_attr['scope'], "'\"");
|
||||||
if ($_attr['scope'] == 'parent') {
|
if ($_attr['scope'] == 'parent') {
|
||||||
|
@@ -375,7 +375,8 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
$this->cacheFileChecked = true;
|
$this->cacheFileChecked = true;
|
||||||
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] >= 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
|
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;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
|
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 > $this->getCachedTimestamp()) {
|
||||||
If ($mtime > $_file_to_check[1]) {
|
If ($mtime > $_file_to_check[1]) {
|
||||||
|
$this->tpl_vars = array();
|
||||||
$this->rendered_content = null;
|
$this->rendered_content = null;
|
||||||
return $this->isCached;
|
return $this->isCached;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user