Skip to content

Commit

Permalink
Merge branch 'wxiaoguang-fix-escape-5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Feb 5, 2024
2 parents 0912124 + d5adea5 commit 15e48b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/930.md
@@ -0,0 +1 @@
- Fix incorrect compilation of expressions when escape_html=true [#930](https://github.com/smarty-php/smarty/pull/930)
2 changes: 1 addition & 1 deletion src/Compile/PrintExpressionCompiler.php
Expand Up @@ -84,7 +84,7 @@ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter =
}

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) . "')";
}

}
Expand Down

0 comments on commit 15e48b6

Please sign in to comment.