Skip to content

Commit

Permalink
[BUGFIX] PR-453 Return text node with the full text instead instead o…
Browse files Browse the repository at this point in the history
…f dying (#454)
  • Loading branch information
thomashohn authored and mbrodala committed Jul 18, 2019
1 parent d8ccbcd commit 865890c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/Parser/TemplateParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ public function unquoteString($quotedValue)
protected function textAndShorthandSyntaxHandler(ParsingState $state, $text, $context)
{
$sections = preg_split(Patterns::$SPLIT_PATTERN_SHORTHANDSYNTAX, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
if ($sections === false) {
// String $text was not possible to split; we must return a text node with the full text instead.
$this->textHandler($state, $text);
return;
}
foreach ($sections as $section) {
$matchedVariables = [];
$expressionNode = null;
Expand Down

0 comments on commit 865890c

Please sign in to comment.