diff options
| author | uwetews <uwe.tews@googlemail.com> | 2016-02-10 03:19:25 +0100 |
|---|---|---|
| committer | uwetews <uwe.tews@googlemail.com> | 2016-02-10 03:19:25 +0100 |
| commit | 47237eb84f3709394356384676a037d9ef77b05f (patch) | |
| tree | 1e6816c358606af082dc7416da7a66d1946a6838 /lexer/smarty_internal_templatelexer.plex | |
| parent | 417088bdb7c68ad4d71aef4c003f1b079945e325 (diff) | |
| download | smarty-47237eb84f3709394356384676a037d9ef77b05f.tar.gz smarty-47237eb84f3709394356384676a037d9ef77b05f.tar.bz2 smarty-47237eb84f3709394356384676a037d9ef77b05f.zip | |
- bugfix wrong precedence on special if conditions like '$foo is ... by $bar' could cause wrong code https://github.com/smarty-php/smarty/issues/178
Diffstat (limited to 'lexer/smarty_internal_templatelexer.plex')
| -rw-r--r-- | lexer/smarty_internal_templatelexer.plex | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lexer/smarty_internal_templatelexer.plex b/lexer/smarty_internal_templatelexer.plex index 7a2d81f5..1457c2f9 100644 --- a/lexer/smarty_internal_templatelexer.plex +++ b/lexer/smarty_internal_templatelexer.plex @@ -306,7 +306,8 @@ class Smarty_Internal_Templatelexer literal = ~literal~ strip = ~strip~ lop = ~\s*(([!=][=]{1,2})|([<][=>]?)|([>][=]?)|[&|]{2})\s*~ - tlop = ~\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor|(is\s+(not\s+)?(odd|even|div)\s+by))\s+~ + slop = ~\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\s+~ + tlop = ~\s+(is\s+(not\s+)?(odd|even|div)\s+by)\s+~ scond = ~\s+is\s+(not\s+)?(odd|even)~ isin = ~\s+is\s+in\s+~ as = ~\s+as\s+~ @@ -479,6 +480,9 @@ class Smarty_Internal_Templatelexer lop { $this->token = Smarty_Internal_Templateparser::TP_LOGOP; } + slop { + $this->token = Smarty_Internal_Templateparser::TP_SLOGOP; + } tlop { $this->token = Smarty_Internal_Templateparser::TP_TLOGOP; } |
