From 21ed644f820a73a022f4c18fe1eac6541fbd2bd9 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Mon, 15 Nov 2010 19:17:18 +0000 Subject: [PATCH] - bugfix when using {$smarty.session} as object - bugfix scoping problem on $smarty object passed to filters --- change_log.txt | 4 + libs/Smarty.class.php | 2 +- ...ernal_compile_private_print_expression.php | 2 +- ...ernal_compile_private_special_variable.php | 2 +- libs/sysplugins/smarty_internal_data.php | 26 +- .../smarty_internal_filter_handler.php | 24 +- .../smarty_internal_templatecompilerbase.php | 4 +- .../smarty_internal_templateparser.php | 286 +++++++++--------- 8 files changed, 187 insertions(+), 163 deletions(-) diff --git a/change_log.txt b/change_log.txt index d6491979..6850dd28 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,7 @@ +15/11/2010 +- bugfix when using {$smarty.session} as object +- bugfix scoping problem on $smarty object passed to filters + 14/11/2010 - bugfix isset() did not allow multiple parameter - improvment of some error messages diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 06fee411..bfacad10 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -330,7 +330,7 @@ class Smarty extends Smarty_Internal_Data { } // return redered template if (isset($this->autoload_filters['output']) || isset($this->registered_filters['output'])) { - $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $this, $_template); + $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $_template); } else { $_output = $_template->getRenderedTemplate(); } diff --git a/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/libs/sysplugins/smarty_internal_compile_private_print_expression.php index 3843428f..5a9c9319 100644 --- a/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -48,7 +48,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C } else { // display value if (!$_attr['nofilter'] && isset($this->compiler->smarty->registered_filters['variable'])) { - $output = "Smarty_Internal_Filter_Handler::runFilter('variable', {$parameter['value']},\$_smarty_tpl->smarty, \$_smarty_tpl, {$_filter})"; + $output = "Smarty_Internal_Filter_Handler::runFilter('variable', {$parameter['value']}, \$_smarty_tpl, {$_filter})"; } else { $output = $parameter['value']; } diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 76527f4e..49ec9096 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -104,7 +104,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiled_ref = $compiled_ref . "[$_ind]"; } } - return "(isset($compiled_ref)? $compiled_ref : null)"; + return $compiled_ref; } } diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php index 5b8d48ab..40482f44 100644 --- a/libs/sysplugins/smarty_internal_data.php +++ b/libs/sysplugins/smarty_internal_data.php @@ -338,16 +338,30 @@ class Smarty_Internal_Data { * @param string $varname variable name or null * @return string variable value or or array of variables */ - function getConfigVars($varname = null) + function getConfigVars($varname = null, $search_parents = true) { - if (isset($varname)) { - if (isset($this->config_vars[$varname])) { - return $this->config_vars[$varname]; + // var_dump($this); + $_ptr = $this; + $var_array = array(); + while ($_ptr !== null) { + if (isset($varname)) { + if (isset($_ptr->config_vars[$varname])) { + return $_ptr->config_vars[$varname]; + } } else { - return ''; + $var_array = array_merge($_ptr->config_vars, $var_array); + } + // not found, try at parent + if ($search_parents) { + $_ptr = $_ptr->parent; + } else { + $_ptr = null; } + } + if (isset($varname)) { + return ''; } else { - return $this->config_vars; + return $var_array; } } diff --git a/libs/sysplugins/smarty_internal_filter_handler.php b/libs/sysplugins/smarty_internal_filter_handler.php index 1992b55e..fbd88460 100644 --- a/libs/sysplugins/smarty_internal_filter_handler.php +++ b/libs/sysplugins/smarty_internal_filter_handler.php @@ -26,21 +26,21 @@ class Smarty_Internal_Filter_Handler { * @param string $content the content which shall be processed by the filters * @return string the filtered content */ - static function runFilter($type, $content, $smarty, $template, $flag = null) + static function runFilter($type, $content, $template, $flag = null) { $output = $content; - if ($type != 'variable' || ($smarty->variable_filter && $flag !== false) || $flag === true) { + if ($type != 'variable' || ($template->smarty->variable_filter && $flag !== false) || $flag === true) { // loop over autoload filters of specified type - if (!empty($smarty->autoload_filters[$type])) { - foreach ((array)$smarty->autoload_filters[$type] as $name) { + if (!empty($template->smarty->autoload_filters[$type])) { + foreach ((array)$template->smarty->autoload_filters[$type] as $name) { $plugin_name = "Smarty_{$type}filter_{$name}"; - if ($smarty->loadPlugin($plugin_name)) { + if ($template->smarty->loadPlugin($plugin_name)) { if (function_exists($plugin_name)) { // use loaded Smarty2 style plugin - $output = $plugin_name($output, $smarty); + $output = $plugin_name($output, $template); } elseif (class_exists($plugin_name, false)) { // loaded class of filter plugin - $output = call_user_func(array($plugin_name, 'execute'), $output, $smarty, $template); + $output = call_user_func(array($plugin_name, 'execute'), $output, $template); } } else { // nothing found, throw exception @@ -49,12 +49,12 @@ class Smarty_Internal_Filter_Handler { } } // loop over registerd filters of specified type - if (!empty($smarty->registered_filters[$type])) { - foreach ($smarty->registered_filters[$type] as $key => $name) { - if (is_array($smarty->registered_filters[$type][$key])) { - $output = call_user_func($smarty->registered_filters[$type][$key], $output, $smarty, $template); + if (!empty($template->smarty->registered_filters[$type])) { + foreach ($template->smarty->registered_filters[$type] as $key => $name) { + if (is_array($template->smarty->registered_filters[$type][$key])) { + $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template); } else { - $output = $smarty->registered_filters[$type][$key]($output, $smarty, $template); + $output = $template->smarty->registered_filters[$type][$key]($output, $template); } } } diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index cca15784..ffa7955e 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -67,7 +67,7 @@ class Smarty_Internal_TemplateCompilerBase { $_content = $template->getTemplateSource(); // run prefilter if required if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) { - $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $this->smarty, $template); + $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template); } // on empty template just return header if ($_content == '') { @@ -89,7 +89,7 @@ class Smarty_Internal_TemplateCompilerBase { } // run postfilter if required if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) { - $template->compiled_template = Smarty_Internal_Filter_Handler::runFilter('post', $template->compiled_template, $this->smarty, $template); + $template->compiled_template = Smarty_Internal_Filter_Handler::runFilter('post', $template->compiled_template, $template); } } diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index df619aa6..2bd3c388 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -2474,7 +2474,13 @@ static public $yy_action = array( function yy_r115(){ $this->prefix_number++; $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + 0]->minor.'prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; } #line 2471 "smarty_internal_templateparser.php" #line 445 "smarty_internal_templateparser.y" - function yy_r116(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + function yy_r116(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { + $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + if (substr($smarty_var,0,1) == "'" || substr($smarty_var,0,1) == '@') { + $this->_retvalue = $smarty_var; + } else { + $this->_retvalue = '(isset('.$smarty_var.')?'.$smarty_var.':null)'; + } } else { if (isset($this->compiler->local_var[$this->yystack[$this->yyidx + 0]->minor['var']])) { $this->_retvalue = '(isset($_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + 0]->minor['var'] .']->value'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'].') ? $_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + 0]->minor['var'] .']->value'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'].' : null)'; @@ -2486,105 +2492,105 @@ static public $yy_action = array( } } $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"), null, true, false)->nocache;} } -#line 2485 "smarty_internal_templateparser.php" -#line 458 "smarty_internal_templateparser.y" +#line 2491 "smarty_internal_templateparser.php" +#line 464 "smarty_internal_templateparser.y" function yy_r117(){if (isset($this->compiler->local_var[$this->yystack[$this->yyidx + -2]->minor])) { $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor; } else { $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; } $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"), null, true, false)->nocache; } -#line 2493 "smarty_internal_templateparser.php" -#line 467 "smarty_internal_templateparser.y" - function yy_r119(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; } -#line 2496 "smarty_internal_templateparser.php" -#line 468 "smarty_internal_templateparser.y" - function yy_r120(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; } #line 2499 "smarty_internal_templateparser.php" -#line 471 "smarty_internal_templateparser.y" - function yy_r121(){$this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } +#line 473 "smarty_internal_templateparser.y" + function yy_r119(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; } #line 2502 "smarty_internal_templateparser.php" -#line 477 "smarty_internal_templateparser.y" - function yy_r122(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } +#line 474 "smarty_internal_templateparser.y" + function yy_r120(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; } #line 2505 "smarty_internal_templateparser.php" -#line 479 "smarty_internal_templateparser.y" - function yy_r123(){return; } +#line 477 "smarty_internal_templateparser.y" + function yy_r121(){$this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); } #line 2508 "smarty_internal_templateparser.php" #line 483 "smarty_internal_templateparser.y" - function yy_r124(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor .')->value]'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + 0]->minor', null, true, false)->nocache; } + function yy_r122(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } #line 2511 "smarty_internal_templateparser.php" -#line 484 "smarty_internal_templateparser.y" - function yy_r125(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor.']'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"), null, true, false)->nocache; } -#line 2514 "smarty_internal_templateparser.php" #line 485 "smarty_internal_templateparser.y" - function yy_r126(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; } -#line 2517 "smarty_internal_templateparser.php" -#line 486 "smarty_internal_templateparser.y" - function yy_r127(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; } -#line 2520 "smarty_internal_templateparser.php" -#line 487 "smarty_internal_templateparser.y" - function yy_r128(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; } -#line 2523 "smarty_internal_templateparser.php" + function yy_r123(){return; } +#line 2514 "smarty_internal_templateparser.php" #line 489 "smarty_internal_templateparser.y" - function yy_r129(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; } -#line 2526 "smarty_internal_templateparser.php" + function yy_r124(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor .')->value]'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + 0]->minor', null, true, false)->nocache; } +#line 2517 "smarty_internal_templateparser.php" #line 490 "smarty_internal_templateparser.y" - function yy_r130(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; } + function yy_r125(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor.']'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"), null, true, false)->nocache; } +#line 2520 "smarty_internal_templateparser.php" +#line 491 "smarty_internal_templateparser.y" + function yy_r126(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; } +#line 2523 "smarty_internal_templateparser.php" +#line 492 "smarty_internal_templateparser.y" + function yy_r127(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; } +#line 2526 "smarty_internal_templateparser.php" +#line 493 "smarty_internal_templateparser.y" + function yy_r128(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; } #line 2529 "smarty_internal_templateparser.php" -#line 494 "smarty_internal_templateparser.y" - function yy_r132(){$this->_retvalue = '[]'; } +#line 495 "smarty_internal_templateparser.y" + function yy_r129(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; } #line 2532 "smarty_internal_templateparser.php" -#line 502 "smarty_internal_templateparser.y" - function yy_r134(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } +#line 496 "smarty_internal_templateparser.y" + function yy_r130(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; } #line 2535 "smarty_internal_templateparser.php" -#line 504 "smarty_internal_templateparser.y" - function yy_r135(){$this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } +#line 500 "smarty_internal_templateparser.y" + function yy_r132(){$this->_retvalue = '[]'; } #line 2538 "smarty_internal_templateparser.php" -#line 506 "smarty_internal_templateparser.y" - function yy_r136(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } +#line 508 "smarty_internal_templateparser.y" + function yy_r134(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } #line 2541 "smarty_internal_templateparser.php" -#line 511 "smarty_internal_templateparser.y" +#line 510 "smarty_internal_templateparser.y" + function yy_r135(){$this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } +#line 2544 "smarty_internal_templateparser.php" +#line 512 "smarty_internal_templateparser.y" + function yy_r136(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } +#line 2547 "smarty_internal_templateparser.php" +#line 517 "smarty_internal_templateparser.y" function yy_r137(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor;} else { $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"), null, true, false)->nocache;} } -#line 2545 "smarty_internal_templateparser.php" -#line 514 "smarty_internal_templateparser.y" - function yy_r138(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } -#line 2548 "smarty_internal_templateparser.php" -#line 516 "smarty_internal_templateparser.y" - function yy_r139(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } #line 2551 "smarty_internal_templateparser.php" -#line 518 "smarty_internal_templateparser.y" +#line 520 "smarty_internal_templateparser.y" + function yy_r138(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } +#line 2554 "smarty_internal_templateparser.php" +#line 522 "smarty_internal_templateparser.y" + function yy_r139(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } +#line 2557 "smarty_internal_templateparser.php" +#line 524 "smarty_internal_templateparser.y" function yy_r140(){if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') { $this->compiler->trigger_template_error (self::Err1); } $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } -#line 2558 "smarty_internal_templateparser.php" -#line 523 "smarty_internal_templateparser.y" +#line 2564 "smarty_internal_templateparser.php" +#line 529 "smarty_internal_templateparser.y" function yy_r141(){if ($this->security) { $this->compiler->trigger_template_error (self::Err2); } $this->_retvalue = '->{$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor .')->value'.$this->yystack[$this->yyidx + 0]->minor.'}'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor,"'"), null, true, false)->nocache; } -#line 2565 "smarty_internal_templateparser.php" -#line 528 "smarty_internal_templateparser.y" +#line 2571 "smarty_internal_templateparser.php" +#line 534 "smarty_internal_templateparser.y" function yy_r142(){if ($this->security) { $this->compiler->trigger_template_error (self::Err2); } $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -#line 2572 "smarty_internal_templateparser.php" -#line 533 "smarty_internal_templateparser.y" +#line 2578 "smarty_internal_templateparser.php" +#line 539 "smarty_internal_templateparser.y" function yy_r143(){if ($this->security) { $this->compiler->trigger_template_error (self::Err2); } $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; } -#line 2579 "smarty_internal_templateparser.php" -#line 539 "smarty_internal_templateparser.y" - function yy_r144(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } -#line 2582 "smarty_internal_templateparser.php" +#line 2585 "smarty_internal_templateparser.php" #line 545 "smarty_internal_templateparser.y" + function yy_r144(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; } +#line 2588 "smarty_internal_templateparser.php" +#line 551 "smarty_internal_templateparser.y" function yy_r145(){if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) { if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0) { @@ -2609,115 +2615,115 @@ static public $yy_action = array( $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); } } } -#line 2608 "smarty_internal_templateparser.php" -#line 573 "smarty_internal_templateparser.y" +#line 2614 "smarty_internal_templateparser.php" +#line 579 "smarty_internal_templateparser.y" function yy_r146(){if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') { $this->compiler->trigger_template_error (self::Err1); } $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")"; } -#line 2615 "smarty_internal_templateparser.php" -#line 578 "smarty_internal_templateparser.y" +#line 2621 "smarty_internal_templateparser.php" +#line 584 "smarty_internal_templateparser.y" function yy_r147(){if ($this->security) { $this->compiler->trigger_template_error (self::Err2); } $this->prefix_number++; $this->compiler->prefix_code[] = 'prefix_number.'=$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + -3]->minor .'\')->value;?>'; $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; } -#line 2622 "smarty_internal_templateparser.php" -#line 586 "smarty_internal_templateparser.y" - function yy_r148(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); } -#line 2625 "smarty_internal_templateparser.php" -#line 595 "smarty_internal_templateparser.y" - function yy_r151(){$this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); } #line 2628 "smarty_internal_templateparser.php" -#line 596 "smarty_internal_templateparser.y" - function yy_r152(){$this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); } +#line 592 "smarty_internal_templateparser.y" + function yy_r148(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); } #line 2631 "smarty_internal_templateparser.php" -#line 599 "smarty_internal_templateparser.y" - function yy_r154(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } +#line 601 "smarty_internal_templateparser.y" + function yy_r151(){$this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); } #line 2634 "smarty_internal_templateparser.php" -#line 604 "smarty_internal_templateparser.y" - function yy_r155(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } +#line 602 "smarty_internal_templateparser.y" + function yy_r152(){$this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); } #line 2637 "smarty_internal_templateparser.php" -#line 606 "smarty_internal_templateparser.y" - function yy_r156(){$this->_retvalue = array(); } +#line 605 "smarty_internal_templateparser.y" + function yy_r154(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } #line 2640 "smarty_internal_templateparser.php" -#line 608 "smarty_internal_templateparser.y" - function yy_r157(){$this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } +#line 610 "smarty_internal_templateparser.y" + function yy_r155(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); } #line 2643 "smarty_internal_templateparser.php" -#line 618 "smarty_internal_templateparser.y" - function yy_r162(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } +#line 612 "smarty_internal_templateparser.y" + function yy_r156(){$this->_retvalue = array(); } #line 2646 "smarty_internal_templateparser.php" -#line 620 "smarty_internal_templateparser.y" - function yy_r163(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } +#line 614 "smarty_internal_templateparser.y" + function yy_r157(){$this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); } #line 2649 "smarty_internal_templateparser.php" -#line 629 "smarty_internal_templateparser.y" - function yy_r164(){$this->_retvalue = '=='; } +#line 624 "smarty_internal_templateparser.y" + function yy_r162(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } #line 2652 "smarty_internal_templateparser.php" -#line 630 "smarty_internal_templateparser.y" - function yy_r165(){$this->_retvalue = '!='; } +#line 626 "smarty_internal_templateparser.y" + function yy_r163(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } #line 2655 "smarty_internal_templateparser.php" -#line 631 "smarty_internal_templateparser.y" - function yy_r166(){$this->_retvalue = '>'; } -#line 2658 "smarty_internal_templateparser.php" -#line 632 "smarty_internal_templateparser.y" - function yy_r167(){$this->_retvalue = '<'; } -#line 2661 "smarty_internal_templateparser.php" -#line 633 "smarty_internal_templateparser.y" - function yy_r168(){$this->_retvalue = '>='; } -#line 2664 "smarty_internal_templateparser.php" -#line 634 "smarty_internal_templateparser.y" - function yy_r169(){$this->_retvalue = '<='; } -#line 2667 "smarty_internal_templateparser.php" #line 635 "smarty_internal_templateparser.y" - function yy_r170(){$this->_retvalue = '==='; } -#line 2670 "smarty_internal_templateparser.php" + function yy_r164(){$this->_retvalue = '=='; } +#line 2658 "smarty_internal_templateparser.php" #line 636 "smarty_internal_templateparser.y" - function yy_r171(){$this->_retvalue = '!=='; } -#line 2673 "smarty_internal_templateparser.php" + function yy_r165(){$this->_retvalue = '!='; } +#line 2661 "smarty_internal_templateparser.php" #line 637 "smarty_internal_templateparser.y" - function yy_r172(){$this->_retvalue = '%'; } -#line 2676 "smarty_internal_templateparser.php" + function yy_r166(){$this->_retvalue = '>'; } +#line 2664 "smarty_internal_templateparser.php" +#line 638 "smarty_internal_templateparser.y" + function yy_r167(){$this->_retvalue = '<'; } +#line 2667 "smarty_internal_templateparser.php" #line 639 "smarty_internal_templateparser.y" - function yy_r173(){$this->_retvalue = '&&'; } -#line 2679 "smarty_internal_templateparser.php" + function yy_r168(){$this->_retvalue = '>='; } +#line 2670 "smarty_internal_templateparser.php" #line 640 "smarty_internal_templateparser.y" - function yy_r174(){$this->_retvalue = '||'; } -#line 2682 "smarty_internal_templateparser.php" + function yy_r169(){$this->_retvalue = '<='; } +#line 2673 "smarty_internal_templateparser.php" #line 641 "smarty_internal_templateparser.y" - function yy_r175(){$this->_retvalue = ' XOR '; } + function yy_r170(){$this->_retvalue = '==='; } +#line 2676 "smarty_internal_templateparser.php" +#line 642 "smarty_internal_templateparser.y" + function yy_r171(){$this->_retvalue = '!=='; } +#line 2679 "smarty_internal_templateparser.php" +#line 643 "smarty_internal_templateparser.y" + function yy_r172(){$this->_retvalue = '%'; } +#line 2682 "smarty_internal_templateparser.php" +#line 645 "smarty_internal_templateparser.y" + function yy_r173(){$this->_retvalue = '&&'; } #line 2685 "smarty_internal_templateparser.php" #line 646 "smarty_internal_templateparser.y" - function yy_r176(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } + function yy_r174(){$this->_retvalue = '||'; } #line 2688 "smarty_internal_templateparser.php" -#line 648 "smarty_internal_templateparser.y" - function yy_r178(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } +#line 647 "smarty_internal_templateparser.y" + function yy_r175(){$this->_retvalue = ' XOR '; } #line 2691 "smarty_internal_templateparser.php" -#line 649 "smarty_internal_templateparser.y" - function yy_r179(){ return; } +#line 652 "smarty_internal_templateparser.y" + function yy_r176(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } #line 2694 "smarty_internal_templateparser.php" -#line 650 "smarty_internal_templateparser.y" - function yy_r180(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } +#line 654 "smarty_internal_templateparser.y" + function yy_r178(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } #line 2697 "smarty_internal_templateparser.php" -#line 651 "smarty_internal_templateparser.y" - function yy_r181(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } +#line 655 "smarty_internal_templateparser.y" + function yy_r179(){ return; } #line 2700 "smarty_internal_templateparser.php" -#line 658 "smarty_internal_templateparser.y" - function yy_r183(){ $this->_retvalue = "''"; } +#line 656 "smarty_internal_templateparser.y" + function yy_r180(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } #line 2703 "smarty_internal_templateparser.php" -#line 659 "smarty_internal_templateparser.y" - function yy_r184(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); } +#line 657 "smarty_internal_templateparser.y" + function yy_r181(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } #line 2706 "smarty_internal_templateparser.php" -#line 661 "smarty_internal_templateparser.y" - function yy_r185(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } -#line 2709 "smarty_internal_templateparser.php" -#line 662 "smarty_internal_templateparser.y" - function yy_r186(){ $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); } -#line 2712 "smarty_internal_templateparser.php" #line 664 "smarty_internal_templateparser.y" - function yy_r187(){ $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); } + function yy_r183(){ $this->_retvalue = "''"; } +#line 2709 "smarty_internal_templateparser.php" +#line 665 "smarty_internal_templateparser.y" + function yy_r184(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); } +#line 2712 "smarty_internal_templateparser.php" +#line 667 "smarty_internal_templateparser.y" + function yy_r185(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } #line 2715 "smarty_internal_templateparser.php" -#line 666 "smarty_internal_templateparser.y" +#line 668 "smarty_internal_templateparser.y" + function yy_r186(){ $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); } +#line 2718 "smarty_internal_templateparser.php" +#line 670 "smarty_internal_templateparser.y" + function yy_r187(){ $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); } +#line 2721 "smarty_internal_templateparser.php" +#line 672 "smarty_internal_templateparser.y" function yy_r189(){if (isset($this->compiler->local_var["'".substr($this->yystack[$this->yyidx + 0]->minor,1)."'"])) { $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); } else { @@ -2725,21 +2731,21 @@ static public $yy_action = array( } $this->compiler->tag_nocache = $this->compiler->tag_nocache | $this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"), null, true, false)->nocache; } -#line 2724 "smarty_internal_templateparser.php" -#line 674 "smarty_internal_templateparser.y" +#line 2730 "smarty_internal_templateparser.php" +#line 680 "smarty_internal_templateparser.y" function yy_r191(){ $this->_retvalue = new _smarty_code($this, '('.$this->yystack[$this->yyidx + -1]->minor.')'); } -#line 2727 "smarty_internal_templateparser.php" -#line 675 "smarty_internal_templateparser.y" +#line 2733 "smarty_internal_templateparser.php" +#line 681 "smarty_internal_templateparser.y" function yy_r192(){ $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); } -#line 2732 "smarty_internal_templateparser.php" -#line 678 "smarty_internal_templateparser.y" - function yy_r193(){ $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); } -#line 2735 "smarty_internal_templateparser.php" -#line 685 "smarty_internal_templateparser.y" - function yy_r195(){$this->_retvalue = ''; } #line 2738 "smarty_internal_templateparser.php" +#line 684 "smarty_internal_templateparser.y" + function yy_r193(){ $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); } +#line 2741 "smarty_internal_templateparser.php" +#line 691 "smarty_internal_templateparser.y" + function yy_r195(){$this->_retvalue = ''; } +#line 2744 "smarty_internal_templateparser.php" private $_retvalue; @@ -2801,7 +2807,7 @@ static public $yy_action = array( $this->internalError = true; $this->yymajor = $yymajor; $this->compiler->trigger_template_error(); -#line 2801 "smarty_internal_templateparser.php" +#line 2807 "smarty_internal_templateparser.php" } function yy_accept() @@ -2818,7 +2824,7 @@ static public $yy_action = array( $this->internalError = false; $this->retvalue = $this->_retvalue; //echo $this->retvalue."\n\n"; -#line 2819 "smarty_internal_templateparser.php" +#line 2825 "smarty_internal_templateparser.php" } function doParse($yymajor, $yytokenvalue)