From a7f7267b04b1a90a697331540943db85e93d379d Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Mon, 12 Mar 2012 19:25:30 +0000 Subject: [PATCH] - bugfix a double quoted string of "$foo" did not compile into PHP "$foo" (Forum Topic 21175) --- change_log.txt | 3 +++ .../smarty_internal_templateparser.php | 25 +++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/change_log.txt b/change_log.txt index 96c43131..700715f1 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +12.03.2012 +- bugfix a double quoted string of "$foo" did not compile into PHP "$foo" (Forum Topic 21175) + 03.03.2012 - optimization of compiling speed when same modifier was used several times diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index 94dca0ac..4896b46d 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -2175,8 +2175,8 @@ static public $yy_action = array( 191 => 191, 192 => 192, 193 => 193, - 194 => 193, 196 => 193, + 194 => 194, 195 => 195, 197 => 197, 198 => 198, @@ -3068,29 +3068,34 @@ static public $yy_action = array( #line 3064 "smarty_internal_templateparser.php" #line 1200 "smarty_internal_templateparser.y" function yy_r193(){ - $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); + $this->_retvalue = new _smarty_code($this, '"{'.$this->yystack[$this->yyidx + -1]->minor.'}"'); } #line 3069 "smarty_internal_templateparser.php" -#line 1208 "smarty_internal_templateparser.y" - function yy_r195(){ - $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); +#line 1204 "smarty_internal_templateparser.y" + function yy_r194(){ + $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); } #line 3074 "smarty_internal_templateparser.php" +#line 1208 "smarty_internal_templateparser.y" + function yy_r195(){ + $this->_retvalue = new _smarty_code($this, '"{$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value}"'); + } +#line 3079 "smarty_internal_templateparser.php" #line 1216 "smarty_internal_templateparser.y" function yy_r197(){ $this->_retvalue = new _smarty_code($this, '('.$this->yystack[$this->yyidx + -1]->minor.')'); } -#line 3079 "smarty_internal_templateparser.php" +#line 3084 "smarty_internal_templateparser.php" #line 1220 "smarty_internal_templateparser.y" function yy_r198(){ $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor); } -#line 3084 "smarty_internal_templateparser.php" +#line 3089 "smarty_internal_templateparser.php" #line 1224 "smarty_internal_templateparser.y" function yy_r199(){ $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); } -#line 3089 "smarty_internal_templateparser.php" +#line 3094 "smarty_internal_templateparser.php" private $_retvalue; @@ -3152,7 +3157,7 @@ static public $yy_action = array( $this->internalError = true; $this->yymajor = $yymajor; $this->compiler->trigger_template_error(); -#line 3152 "smarty_internal_templateparser.php" +#line 3157 "smarty_internal_templateparser.php" } function yy_accept() @@ -3169,7 +3174,7 @@ static public $yy_action = array( $this->internalError = false; $this->retvalue = $this->_retvalue; //echo $this->retvalue."\n\n"; -#line 3170 "smarty_internal_templateparser.php" +#line 3175 "smarty_internal_templateparser.php" } function doParse($yymajor, $yytokenvalue)