diff options
| author | Simon Wisselink <s.wisselink@iwink.nl> | 2024-02-05 14:11:44 +0100 |
|---|---|---|
| committer | Simon Wisselink <s.wisselink@iwink.nl> | 2024-02-05 14:11:44 +0100 |
| commit | 15e48b6af3cd296882bdcfc9942419f50ed8592c (patch) | |
| tree | 321f2d01287c6678d499f26a4380ae2d0830d7bf | |
| parent | 0912124c33c3b36b3eb2aa65768dfbed19026284 (diff) | |
| parent | d5adea586357c102b679175f47babf39f6acdb42 (diff) | |
| download | smarty-15e48b6af3cd296882bdcfc9942419f50ed8592c.tar.gz smarty-15e48b6af3cd296882bdcfc9942419f50ed8592c.tar.bz2 smarty-15e48b6af3cd296882bdcfc9942419f50ed8592c.zip | |
Merge branch 'wxiaoguang-fix-escape-5.0'
| -rw-r--r-- | changelog/930.md | 1 | ||||
| -rw-r--r-- | src/Compile/PrintExpressionCompiler.php | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/changelog/930.md b/changelog/930.md new file mode 100644 index 00000000..d9af7c2a --- /dev/null +++ b/changelog/930.md @@ -0,0 +1 @@ +- Fix incorrect compilation of expressions when escape_html=true [#930](https://github.com/smarty-php/smarty/pull/930)
\ No newline at end of file diff --git a/src/Compile/PrintExpressionCompiler.php b/src/Compile/PrintExpressionCompiler.php index 99a03901..486512d4 100644 --- a/src/Compile/PrintExpressionCompiler.php +++ b/src/Compile/PrintExpressionCompiler.php @@ -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) . "')"; } } |
