Skip to content

Commit

Permalink
Brought lexer source functionally up-to-date with compiled version (#625
Browse files Browse the repository at this point in the history
)

Fixes #621
  • Loading branch information
wisskid authored Jan 6, 2021
1 parent e2b2816 commit 92e05d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions lexer/smarty_internal_templateparser.y
Original file line number Diff line number Diff line change
Expand Up @@ -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. {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 92e05d4

Please sign in to comment.