Skip to content

Commit 5f9cbb9

Browse files
Merge pull request #70 from VincentLanglet/fixSlash
🐛 Escape \
2 parents dcee37d + 8d7dee9 commit 5f9cbb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

TwigCS/Token/Tokenizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ protected function lexExpression()
315315
$this->moveCursor($this->code[$this->cursor]);
316316
} elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) {
317317
// strings
318-
$this->pushToken(Token::STRING_TYPE, stripcslashes($match[0]));
318+
$this->pushToken(Token::STRING_TYPE, addcslashes(stripcslashes($match[0]), '\\'));
319319
$this->moveCursor($match[0]);
320320
} else {
321321
// unlexable

0 commit comments

Comments
 (0)