From 5c33be7fc059a8c930b2b68e52a892a809d14ab6 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Tue, 27 Sep 2011 17:15:31 +0000 Subject: [PATCH] - bugfix remove race condition when a custom resource did change timestamp during compilation --- change_log.txt | 1 + libs/sysplugins/smarty_internal_template.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 2e76b126..e31d0ed6 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 27.09.2011 - bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34) - added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now +- bugfix remove race condition when a custom resource did change timestamp during compilation 26.09.2011 - bugfix repeated calls to same subtemplate did not make use of cached template object diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 33f0e58f..85dac239 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -414,7 +414,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { $is_valid = true; if ($this->properties['version'] != Smarty::SMARTY_VERSION) { $is_valid = false; - } else if (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties)) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) { + } else if (((!$cache && $this->smarty->compile_check && empty($this->compiled->_properties) && !$this->compiled->isCompiled) || $cache && ($this->smarty->compile_check === true || $this->smarty->compile_check === Smarty::COMPILECHECK_ON)) && !empty($this->properties['file_dependency'])) { foreach ($this->properties['file_dependency'] as $_file_to_check) { if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'php') { if ($this->source->filepath == $_file_to_check[0] && isset($this->source->timestamp)) {