diff options
| author | Simon Wisselink <s.wisselink@iwink.nl> | 2023-03-28 21:46:46 +0200 |
|---|---|---|
| committer | Simon Wisselink <s.wisselink@iwink.nl> | 2023-03-28 21:46:46 +0200 |
| commit | 685662466f653597428966d75a661073104d713d (patch) | |
| tree | 07916716b020062376b67d3bf21eb9b91cee6bf0 /libs | |
| parent | 5512d645218ee27bd290447b756759071333d05c (diff) | |
| parent | 71d113550c262db8f61272e1326ec09959687e09 (diff) | |
| download | smarty-685662466f653597428966d75a661073104d713d.tar.gz smarty-685662466f653597428966d75a661073104d713d.tar.bz2 smarty-685662466f653597428966d75a661073104d713d.zip | |
Merge branch 'js_escape_security_fix'
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/plugins/modifier.escape.php | 4 | ||||
| -rw-r--r-- | libs/plugins/modifiercompiler.escape.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/plugins/modifier.escape.php b/libs/plugins/modifier.escape.php index 11e44682..e168679c 100644 --- a/libs/plugins/modifier.escape.php +++ b/libs/plugins/modifier.escape.php @@ -115,7 +115,9 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements '<!--' => '<\!--', '<s' => '<\s', - '<S' => '<\S' + '<S' => '<\S', + "`" => "\\\\`", + "\${" => "\\\\\\$\\{" ) ); case 'mail': diff --git a/libs/plugins/modifiercompiler.escape.php b/libs/plugins/modifiercompiler.escape.php index 602c3dbf..21b1b4c2 100644 --- a/libs/plugins/modifiercompiler.escape.php +++ b/libs/plugins/modifiercompiler.escape.php @@ -64,7 +64,9 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile // 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 (SmartyException $e) { // pass through to regular plugin fallback |
