Fix {!! !!} unescaped echos not being recognized in template v2

This commit is contained in:
Kijin Sung 2023-10-16 13:15:17 +09:00
parent 1b9e2f58b7
commit 91ab93c03a

View file

@ -779,6 +779,12 @@ class TemplateParser_v2
// Convert {{ double }} curly braces.
$content = preg_replace_callback('#(?<!@)\{\{(.+?)\}\}#s', [$this, '_arrangeOutputFilters'], $content);
// Convert {!! unescaped !!} curly braces.
$content = preg_replace_callback('#(?<!@)\{!!(.+?)!!\}#s', function($match) {
$match[1] .= '|noescape';
return $this->_arrangeOutputFilters($match);
}, $content);
// Convert {single} curly braces.
$content = preg_replace_callback('#(?<!\{)\{(?!\s)([^{}]+?)\}#', [$this, '_arrangeOutputFilters'], $content);