Permalink
Browse files

Use lower case letters in unicodes sequences to match the new encoder…

…'s output
  • Loading branch information...
1 parent 2f1c578 commit c229c7a39c2704e0b5c19c2b4d5edb16ecdcef7f @chancancode chancancode committed Nov 27, 2013
View
6 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
View
2 activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -4,7 +4,7 @@
class ERB
module Util
HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
- JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
+ JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003e', '<' => '\u003c' }
HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/
JSON_ESCAPE_REGEXP = /[&><]/

0 comments on commit c229c7a

Please sign in to comment.