Merge branch 'wxiaoguang-fix-escape-5.0'

This commit is contained in:
Simon Wisselink
2024-02-05 14:11:44 +01:00
2 changed files with 2 additions and 1 deletions

1
changelog/930.md Normal file
View File

@ -0,0 +1 @@
- Fix incorrect compilation of expressions when escape_html=true [#930](https://github.com/smarty-php/smarty/pull/930)

View File

@ -84,7 +84,7 @@ class PrintExpressionCompiler extends Base {
}
if ($compiler->getTemplate()->getSmarty()->escape_html) {
$output = "htmlspecialchars((string) {$output}, ENT_QUOTES, '" . addslashes(\Smarty\Smarty::$_CHARSET) . "')";
$output = "htmlspecialchars((string) ({$output}), ENT_QUOTES, '" . addslashes(\Smarty\Smarty::$_CHARSET) . "')";
}
}