aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorJohn F. Douthat <johndouthat@gmail.com>2013-01-28 16:26:12 -0600
committerGodfrey Chan <godfreykfc@gmail.com>2014-07-02 15:54:47 -0700
commit41de23ec030f79f00aff3bf00640e855de42a9b8 (patch)
treef5e005f18bf49e994bfdd7a605d64ebf13c7911f /activesupport/lib/active_support
parent9eb15ed6a08f76ef683bb10a84f824b9dc379e3a (diff)
downloadrails-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/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/string/output_safety.rb2
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 = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
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.