diff --git a/NEWS b/NEWS index 135ccea8..5e6df1c7 100644 --- a/NEWS +++ b/NEWS @@ -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, diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index f57f6745..fe572d71 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -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 = '_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 = '_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 {