mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-10 17:36:53 +00:00
bug #3401 Fix missing delimiter for preg_quote in lexer (waitxd)
This PR was submitted for the 3.x branch but it was merged into the 1.x branch instead.
Discussion
----------
Fix missing delimiter for preg_quote in lexer
Is is a really edge case (PHP < 7.3 and '#' as whitespace_trim symbol), but for the sake of consistency here's a proper fix.
Commits
-------
41605057 Fix missing delimiter for preg_quote in lexer
This commit is contained in:
+1
-1
@@ -117,7 +117,7 @@ class Lexer implements \Twig_LexerInterface
|
||||
// #}
|
||||
'lex_comment' => '{
|
||||
(?:'.
|
||||
preg_quote($this->options['whitespace_trim']).preg_quote($this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n?
|
||||
preg_quote($this->options['whitespace_trim'].$this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n?
|
||||
'|'.
|
||||
preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]*
|
||||
'|'.
|
||||
|
||||
Reference in New Issue
Block a user