From 70d2e8a4e7f34dfeb6405b83b47dcb673cc3907f Mon Sep 17 00:00:00 2001 From: Amaury Bouchard Date: Tue, 18 Jun 2024 23:00:21 +0200 Subject: [PATCH] Debug 'force' option of escape modifier. --- src/Compile/Modifier/EscapeModifierCompiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compile/Modifier/EscapeModifierCompiler.php b/src/Compile/Modifier/EscapeModifierCompiler.php index 4d14f74f2..b06dd88a4 100644 --- a/src/Compile/Modifier/EscapeModifierCompiler.php +++ b/src/Compile/Modifier/EscapeModifierCompiler.php @@ -28,7 +28,7 @@ public function compile($params, \Smarty\Compiler\Template $compiler) { // in case of auto-escaping, and without the 'force' option, no double-escaping if ($compiler->getSmarty()->escape_html && $esc_type != 'force') return $params[0]; - $compiler->getSmarty()->raw_output = true; + // otherwise, escape the variable return 'htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; // no break