diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2013-11-27 02:46:51 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2013-12-04 09:27:55 -0800 |
commit | c229c7a39c2704e0b5c19c2b4d5edb16ecdcef7f (patch) | |
tree | 867c7184cea72574d32caf046b413e501acb1715 | |
parent | 2f1c5789c1882413df0346fec1f29eed24f37698 (diff) | |
download | rails-c229c7a39c2704e0b5c19c2b4d5edb16ecdcef7f.tar.gz rails-c229c7a39c2704e0b5c19c2b4d5edb16ecdcef7f.tar.bz2 rails-c229c7a39c2704e0b5c19c2b4d5edb16ecdcef7f.zip |
Use lower case letters in unicodes sequences to match the new encoder's output
-rw-r--r-- | actionview/test/template/erb_util_test.rb | 6 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionview/test/template/erb_util_test.rb b/actionview/test/template/erb_util_test.rb index 94552a6d9b..62067ad097 100644 --- a/actionview/test/template/erb_util_test.rb +++ b/actionview/test/template/erb_util_test.rb @@ -31,9 +31,9 @@ class ErbUtilTest < ActiveSupport::TestCase ['1', '1'], ['null', 'null'], ['"&"', '"\u0026"'], - ['"</script>"', '"\u003C/script\u003E"'], - ['["</script>"]', '["\u003C/script\u003E"]'], - ['{"name":"</script>"}', '{"name":"\u003C/script\u003E"}'] + ['"</script>"', '"\u003c/script\u003e"'], + ['["</script>"]', '["\u003c/script\u003e"]'], + ['{"name":"</script>"}', '{"name":"\u003c/script\u003e"}'] ] def test_html_escape 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 d54265f1b1..0e07e5952f 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -4,7 +4,7 @@ require 'active_support/core_ext/kernel/singleton_class' class ERB module Util HTML_ESCAPE = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } - JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' } + JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003e', '<' => '\u003c' } HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/ JSON_ESCAPE_REGEXP = /[&><]/ |