Skip to content

Commit a5bce2f

Browse files
committed
fix: ! for no escape does not work if delimiter is changed
1 parent 8451f91 commit a5bce2f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

system/View/Parser.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,10 @@ protected function replaceSingle($pattern, $content, $template, bool $escape = f
508508
// Replace the content in the template
509509
return preg_replace_callback($pattern, function ($matches) use ($content, $escape) {
510510
// Check for {! !} syntax to not escape this one.
511-
if (strpos($matches[0], '{!') === 0 && substr($matches[0], -2) === '!}') {
511+
if (
512+
strpos($matches[0], $this->leftDelimiter . '!') === 0
513+
&& substr($matches[0], -1 - strlen($this->rightDelimiter)) === '!' . $this->rightDelimiter
514+
) {
512515
$escape = false;
513516
}
514517

0 commit comments

Comments
 (0)