- bugfix on {function} tags and template inheritance

This commit is contained in:
Uwe.Tews
2009-12-10 17:23:32 +00:00
parent bec015821a
commit 048fd5e274
2 changed files with 8 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
12/10/2009
- bugfix on {function} tags and template inheritance
12/05/2009
- fixed problem when a cached file was fetched several times
- removed unneeded lexer code

View File

@@ -66,6 +66,8 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
$_tpl = $this->smarty->createTemplate('string:' . $this->smarty->block_data[$_name]['source'], null, null, $compiler->template);
$_tpl->template_filepath = $this->smarty->block_data[$_name]['file'];
$_tpl->forceNocache = true;
$_tpl->suppressHeader = true;
$_tpl->suppressFileDependency = true;
if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
$_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->template->extracted_compiled_code, $_tpl->getCompiledTemplate());
@@ -75,20 +77,14 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
$_output = $compiler->template->extracted_compiled_code . $_tpl->getCompiledTemplate();
} elseif (!empty($this->smarty->block_data[$_name])) {
$_output = $_tpl->getCompiledTemplate();
}
unset($tpl);
}
$compiler->template->properties = array_merge_recursive($compiler->template->properties, $_tpl->properties);
unset($_tpl);
} else {
$_output = $compiler->template->extracted_compiled_code;
}
$compiler->template->extracted_compiled_code = $saved_data[1];
$compiler->template->extract_code = $saved_data[2];
// check for includes in block tags
preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $_output, $matches);
$_output = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/', '/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $_output);
if (isset($matches[2])) {
$prop = unserialize($matches[2]);
$compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $prop['file_dependency']);
}
return $_output;
}
}