Skip to content

Commit

Permalink
Missed part of commit e751655 in the merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
wisskid committed Aug 7, 2023
1 parent 077df8a commit 515c14b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Compile/Modifier/EscapeModifierCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ public function compile($params, \Smarty\Compiler\Template $compiler) {
// see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
return 'strtr((string)' .
$params[ 0 ] .
', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/", "<!--" => "<\!--", "<s" => "<\s", "<S" => "<\S" ))';
', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r",
"\\n" => "\\\n", "</" => "<\/", "<!--" => "<\!--", "<s" => "<\s", "<S" => "<\S",
"`" => "\\\\`", "\${" => "\\\\\\$\\{"))';
}
} catch (Exception $e) {
// pass through to regular plugin fallback
Expand Down
4 changes: 3 additions & 1 deletion src/Extension/DefaultExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ public function smarty_modifier_escape($string, $esc_type = 'html', $char_set =
// see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
'<!--' => '<\!--',
'<s' => '<\s',
'<S' => '<\S'
'<S' => '<\S',
"`" => "\\\\`",
"\${" => "\\\\\\$\\{"
)
);
case 'mail':
Expand Down

0 comments on commit 515c14b

Please sign in to comment.