make block functions and registered objects' block methods use a

local variable for block_content instead of $this->_block_content

it's not necessary to have $smarty->_block_content accessible.
This commit is contained in:
messju
2005-01-05 10:40:11 +00:00
parent 6cf2f83576
commit e69c336f76
2 changed files with 6 additions and 4 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- make block functions and registered objects' block methods use a
local variable for block_content instead of a property of $smarty (messju)
- fix escaping in the generated code that calls smarty_core_load_plugins
(jes5199, messju)
- fix invalid HTML issue with popup (Stefanos Harhalakis,

View File

@@ -712,8 +712,8 @@ class Smarty_Compiler extends Smarty {
$output .= $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat=true);';
$output .= 'while ($_block_repeat) { ob_start(); ?>';
} else {
$output = '<?php $this->_block_content = ob_get_contents(); ob_end_clean(); ';
$_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $this->_block_content, $this, $_block_repeat=false)';
$output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); ';
$_out_tag_text = $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat=false)';
if ($tag_modifier != '') {
$this->_parse_modifiers($_out_tag_text, $tag_modifier);
}
@@ -860,8 +860,8 @@ class Smarty_Compiler extends Smarty {
$return = null;
$postfix = '';
} else {
$prefix = "\$this->_obj_block_content = ob_get_contents(); ob_end_clean(); ";
$return = "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$this->_obj_block_content, \$this, \$_block_repeat=false)";
$prefix = "\$_obj_block_content = ob_get_contents(); ob_end_clean(); ";
$return = "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$_obj_block_content, \$this, \$_block_repeat=false)";
$postfix = "} array_pop(\$this->_tag_stack);";
}
} else {