diff options
author | John F. Douthat <johndouthat@gmail.com> | 2013-01-28 16:26:12 -0600 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-07-02 15:54:47 -0700 |
commit | 41de23ec030f79f00aff3bf00640e855de42a9b8 (patch) | |
tree | f5e005f18bf49e994bfdd7a605d64ebf13c7911f /activesupport | |
parent | 9eb15ed6a08f76ef683bb10a84f824b9dc379e3a (diff) | |
download | rails-41de23ec030f79f00aff3bf00640e855de42a9b8.tar.gz rails-41de23ec030f79f00aff3bf00640e855de42a9b8.tar.bz2 rails-41de23ec030f79f00aff3bf00640e855de42a9b8.zip |
Fix escape_once double-escaping hex-encoded entities
(This is a manual merge of #9102)
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 46cd170c1d..f0f819cc45 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -7,7 +7,7 @@ class ERB HTML_ESCAPE = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003e', '<' => '\u003c', "\u2028" => '\u2028', "\u2029" => '\u2029' } HTML_ESCAPE_REGEXP = /[&"'><]/ - HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/ + HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+)|(#[xX][\dA-Fa-f]{1,4}));)/ JSON_ESCAPE_REGEXP = /[\u2028\u2029&><]/u # A utility method for escaping HTML tag characters. |