- bugfix on file dependendcy at template inheritance

- bugfix on nocache code at template inheritance
This commit is contained in:
Uwe.Tews
2010-01-07 19:33:18 +00:00
parent 1227de42cc
commit 17a8c7f0a2
4 changed files with 14 additions and 5 deletions

View File

@@ -1,3 +1,7 @@
01/07/2009
- bugfix on file dependency at template inheritance
- bugfix on nocache code at template inheritance
01/06/2009
- fixed typo in smarty_internal_resource_registered
- bugfix for custom delimiter at extends resource and {extends} tag

View File

@@ -64,6 +64,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
$_name = trim($saved_data[0]['name'], "\"'");
if (isset($this->smarty->block_data[$_name])) {
$_tpl = $this->smarty->createTemplate('string:' . $this->smarty->block_data[$_name]['source'], null, null, $compiler->template);
$_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
$_tpl->template_filepath = $this->smarty->block_data[$_name]['file'];
$_tpl->forceNocache = true;
$_tpl->suppressHeader = true;

View File

@@ -443,7 +443,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
}
}
$this->rendered_content = ob_get_clean();
if (!$this->resource_object->isEvaluated) {
if (!$this->resource_object->isEvaluated && empty($this->properties['file_dependency'][$this->templateUid])) {
$this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
}
if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {

View File

@@ -39,7 +39,11 @@ class Smarty_Internal_TemplateCompilerBase {
*/
public function compileTemplate($template)
{
if (empty($template->properties['nocache_hash'])) {
$template->properties['nocache_hash'] = $this->nocache_hash;
} else {
$this->nocache_hash = $template->properties['nocache_hash'];
}
/* here is where the compiling takes place. Smarty
tags in the templates are replaces with PHP code,
then written to compiled files. */