From c573ee9bf809a401c04b64e83ce7d773f2637192 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Mon, 15 Mar 2010 21:40:05 +0000 Subject: [PATCH] - bugfix on block plugin calls --- change_log.txt | 3 +++ .../smarty_internal_compile_private_block_plugin.php | 6 +++--- .../smarty_internal_compile_private_registered_block.php | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/change_log.txt b/change_log.txt index 26d6ac76..f43bdf87 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +15/03/2010 +- bugfix on block plugin calls + 11/03/2010 - changed parsing of back to Smarty2 behaviour diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 0656b77b..436ba247 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -45,7 +45,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; // compile code if (is_array($function)) { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(array('{$function[0]}','{$function[1]}'),{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(array('{$function[0]}','{$function[1]}'),(array({$_params}, null, \$_smarty_tpl->smarty, &\$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; } else { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } @@ -60,7 +60,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi $this->compiler->has_output = true; // compile code if (is_array($function)) { - $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty, &\$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else { $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } @@ -69,4 +69,4 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi } } -?> \ No newline at end of file +?> diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php index 300764d9..3ad4d2fa 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -48,9 +48,9 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C if (!is_array($function)) { $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; } else if (is_object($function[0])) { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0],{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(\$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0],array({$_params}, null, \$_smarty_tpl->smarty, &\$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; } else { - $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func(array('{$function[0]}','{$function[1]}'),{$_params}, null, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl);while (\$_block_repeat) { ob_start();?>"; + $output = "smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; call_user_func_array(array('{$function[0]}','{$function[1]}'),array({$_params}, null, \$_smarty_tpl->smarty, &\$_block_repeat, \$_smarty_tpl));while (\$_block_repeat) { ob_start();?>"; } } else { // must endblock be nocache? @@ -67,9 +67,9 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C if (!is_array($function)) { $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else if (is_object($function[0])) { - $output = "smarty->registered_plugins['block']['{$base_tag}'][0],{$_params}, \$_block_content, \$_smarty_tpl->smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty->registered_plugins['block']['{$base_tag}'][0],array({$_params}, \$_block_content, \$_smarty_tpl->smarty, &\$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } else { - $output = "smarty, \$_block_repeat, \$_smarty_tpl); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; + $output = "smarty, &\$_block_repeat, \$_smarty_tpl)); } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>"; } } return $output."\n";