From 2c570f25b9d739be8b6165a589ffa3d88b4346f4 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Sun, 17 Jan 2010 15:52:37 +0000 Subject: [PATCH] - bugfix on $smarty.const... in double quoted strings --- change_log.txt | 3 +++ .../smarty_internal_templateparser.php | 22 +++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/change_log.txt b/change_log.txt index 73648044..e2752767 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +01/17/2010 +- bugfix on $smarty.const... in double quoted strings + 01/16/2010 - internal change of config file lexer/parser on handling of section names - bugfix on registered objects (format parameter of register_object was not handled correctly) diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index 805e25b3..3ad06029 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -2038,9 +2038,9 @@ static public $yy_action = array( 190 => 190, 191 => 191, 195 => 195, - 196 => 195, + 198 => 195, + 196 => 196, 197 => 197, - 198 => 198, 199 => 199, 200 => 200, ); @@ -2491,23 +2491,23 @@ static public $yy_action = array( function yy_r191(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } #line 2487 "smarty_internal_templateparser.php" #line 543 "smarty_internal_templateparser.y" - function yy_r195(){$this->_retvalue = '{'.$this->yystack[$this->yyidx + -1]->minor.'}'; $this->compiler->has_variable_string = true; } -#line 2490 "smarty_internal_templateparser.php" -#line 545 "smarty_internal_templateparser.y" - function yy_r197(){$this->_retvalue = '{$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')->value}'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"), null, true, false)->nocache; $this->compiler->has_variable_string = true; } -#line 2493 "smarty_internal_templateparser.php" -#line 546 "smarty_internal_templateparser.y" - function yy_r198(){if (substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '\'') { + function yy_r195(){if (substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '\'' || substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '@') { $this->_retvalue = '".'.$this->yystack[$this->yyidx + -1]->minor.'."'; $this->compiler->has_variable_string = true; } else { $this->_retvalue = '{'.$this->yystack[$this->yyidx + -1]->minor.'}'; $this->compiler->has_variable_string = true; } } +#line 2495 "smarty_internal_templateparser.php" +#line 549 "smarty_internal_templateparser.y" + function yy_r196(){$this->_retvalue = '{'.$this->yystack[$this->yyidx + -1]->minor.'}'; $this->compiler->has_variable_string = true; } +#line 2498 "smarty_internal_templateparser.php" +#line 550 "smarty_internal_templateparser.y" + function yy_r197(){$this->_retvalue = '{$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')->value}'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"), null, true, false)->nocache; $this->compiler->has_variable_string = true; } #line 2501 "smarty_internal_templateparser.php" -#line 552 "smarty_internal_templateparser.y" +#line 557 "smarty_internal_templateparser.y" function yy_r199(){ $this->_retvalue = '".('.$this->yystack[$this->yyidx + -1]->minor.')."'; $this->compiler->has_variable_string = true; } #line 2504 "smarty_internal_templateparser.php" -#line 553 "smarty_internal_templateparser.y" +#line 558 "smarty_internal_templateparser.y" function yy_r200(){ $this->prefix_number++; $this->compiler->prefix_code[] = ''.$this->yystack[$this->yyidx + 0]->minor.'prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '{$_tmp'.$this->prefix_number.'}'; $this->compiler->has_variable_string = true; } #line 2507 "smarty_internal_templateparser.php"