summaryrefslogtreecommitdiff
path: root/lexer/smarty_internal_templatelexer.plex
diff options
context:
space:
mode:
authorUwe Tews <uwe.tews@googlemail.com>2015-06-08 23:54:46 +0200
committerUwe Tews <uwe.tews@googlemail.com>2015-06-08 23:54:46 +0200
commitf1e1f56ffe85b4a8f7f238bd33024ff1e14905d7 (patch)
tree22e981658eee6e298e2884f62e885853963f047f /lexer/smarty_internal_templatelexer.plex
parentd804454f21015df3c980db3962008b28147ed289 (diff)
downloadsmarty-f1e1f56ffe85b4a8f7f238bd33024ff1e14905d7.tar.gz
smarty-f1e1f56ffe85b4a8f7f238bd33024ff1e14905d7.tar.bz2
smarty-f1e1f56ffe85b4a8f7f238bd33024ff1e14905d7.zip
- bugfix using {$foo} as array index like $bar.{$foo} or in double quoted string like "some {$foo} thing" failed https://github.com/smarty-php/smarty/issues/49
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
-rw-r--r--lexer/smarty_internal_templatelexer.plex13
1 files changed, 10 insertions, 3 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex
index c6164813..e36df597 100644
--- a/lexer/smarty_internal_templatelexer.plex
+++ b/lexer/smarty_internal_templatelexer.plex
@@ -397,9 +397,16 @@ class Smarty_Internal_Templatelexer
$this->taglineno = $this->line;
}
ldel dollar id nocacherdel {
- $this->yypopstate();
- $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT;
- $this->taglineno = $this->line;
+ if ($this->_yy_stack[count($this->_yy_stack)-1] == self::TEXT) {
+ $this->yypopstate();
+ $this->token = Smarty_Internal_Templateparser::TP_SIMPLEOUTPUT;
+ $this->taglineno = $this->line;
+ } else {
+ $this->value = $this->smarty->left_delimiter;
+ $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+ $this->yybegin(self::TAGBODY);
+ $this->taglineno = $this->line;
+ }
}
ldel slash {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;