- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags

(reported by mh and Issue 83)
This commit is contained in:
uwe.tews@googlemail.com
2012-02-19 15:48:05 +00:00
parent c000b3a480
commit d0ad3df670
2 changed files with 13 additions and 5 deletions

View File

@@ -1,4 +1,8 @@
===== trunk ===== ===== trunk =====
19.02.2012
- bugfix {include} could result in a fatal error if used in appended or prepended nested {block} tags
(reported by mh and Issue 83)
07.02.2012 07.02.2012
- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996) - bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996)
- enhancement cacheable parameter added to default plugin handler, same functionality as in registerPlugin (request by calguy1000) - enhancement cacheable parameter added to default plugin handler, same functionality as in registerPlugin (request by calguy1000)

View File

@@ -240,10 +240,14 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
$_name = trim($saved_data[0]['name'], "\"'"); $_name = trim($saved_data[0]['name'], "\"'");
if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) { if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) {
// restore to status before {block} tag as new subtemplate code of parent {block} is not needed // restore to status before {block} tag as new subtemplate code of parent {block} is not needed
$compiler->merged_templates = $saved_data[4]; // TODO: Below code was disabled in 3.1.8 because of problems with {include} in nested {block} tags in child templates
$compiler->smarty->merged_templates_func = $saved_data[5]; // combined with append/prepend or $smarty.block.parent
$compiler->template->properties = $saved_data[6]; // For later versions it should be checked under which conditions it could run for optimisation
$compiler->template->has_nocache_code = $saved_data[7]; //
//$compiler->merged_templates = $saved_data[4];
//$compiler->smarty->merged_templates_func = $saved_data[5];
//$compiler->template->properties = $saved_data[6];
//$compiler->template->has_nocache_code = $saved_data[7];
$_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name); $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name);
} else { } else {
if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) { if (isset($saved_data[0]['hide']) && !isset($compiler->template->block_data[$_name]['source'])) {
@@ -256,7 +260,7 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
// reset flags // reset flags
$compiler->parser->current_buffer = $saved_data[1]; $compiler->parser->current_buffer = $saved_data[1];
$compiler->nocache = $saved_data[2]; $compiler->nocache = $saved_data[2];
$compiler->smarty->merge_compiled_includes = $saved_data[3]; //$compiler->smarty->merge_compiled_includes = $saved_data[3];
// reset flag for {block} tag // reset flag for {block} tag
$compiler->inheritance = false; $compiler->inheritance = false;
// $_output content has already nocache code processed // $_output content has already nocache code processed