removed use of temporary var $_params in compiled code of block-plugins

This commit is contained in:
messju
2004-01-27 23:00:26 +00:00
parent aa2a705361
commit 0f223e3e18

View File

@@ -711,8 +711,8 @@ class Smarty_Compiler extends Smarty {
$output = '<?php ' . $this->_push_cacheable_state('block', $tag_command); $output = '<?php ' . $this->_push_cacheable_state('block', $tag_command);
$attrs = $this->_parse_attrs($tag_args); $attrs = $this->_parse_attrs($tag_args);
$arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs=''); $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs='');
$output .= "$_cache_attrs\$_params = \$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); '; $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); ';
$output .= $this->_compile_plugin_call('block', $tag_command).'($_params[1], null, $this, $_block_repeat=true); unset($_params);'; $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(); ?>'; $output .= 'while ($_block_repeat) { ob_start(); ?>';
} else { } else {
$output = '<?php $this->_block_content = ob_get_contents(); ob_end_clean(); '; $output = '<?php $this->_block_content = ob_get_contents(); ob_end_clean(); ';
@@ -1887,7 +1887,6 @@ class Smarty_Compiler extends Smarty {
$_map_array = true; $_map_array = true;
} }
$this->_add_plugin('modifier', $_modifier_name);
if (empty($this->_plugins['modifier'][$_modifier_name]) if (empty($this->_plugins['modifier'][$_modifier_name])
&& !$this->_get_plugin_filepath('modifier', $_modifier_name) && !$this->_get_plugin_filepath('modifier', $_modifier_name)
&& function_exists($_modifier_name)) { && function_exists($_modifier_name)) {
@@ -1897,6 +1896,7 @@ class Smarty_Compiler extends Smarty {
$this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false); $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false);
} }
} }
$this->_add_plugin('modifier', $_modifier_name);
$this->_parse_vars_props($_modifier_args); $this->_parse_vars_props($_modifier_args);