diff --git a/CHANGELOG.md b/CHANGELOG.md index 27702e356..acdfc49a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - PHP5.3 compatibility fixes +- Brought lexer source functionally up-to-date with compiled version ## [3.1.36] - 2020-04-14 diff --git a/lexer/smarty_internal_templateparser.y b/lexer/smarty_internal_templateparser.y index b8c00e5d9..c6890642f 100644 --- a/lexer/smarty_internal_templateparser.y +++ b/lexer/smarty_internal_templateparser.y @@ -249,7 +249,13 @@ template ::= template PHP(B). { // template text template ::= template TEXT(B). { - $this->current_buffer->append_subtree($this, $this->compiler->processText(B)); + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($text, $this->strip)); } // strip on template ::= template STRIPON. { @@ -308,7 +314,7 @@ smartytag(A)::= SIMPLETAG(B). { $tag = trim(substr(B, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); if ($tag == 'strip') { $this->strip = true; - A = null;; + A = null; } else { if (defined($tag)) { if ($this->security) {