Skip to content

Commit

Permalink
Use lower case letters in unicodes sequences to match the new encoder…
Browse files Browse the repository at this point in the history
…'s output
  • Loading branch information
chancancode committed Dec 4, 2013
1 parent 2f1c578 commit c229c7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions actionview/test/template/erb_util_test.rb
Expand Up @@ -31,9 +31,9 @@ class ErbUtilTest < ActiveSupport::TestCase
['1', '1'], ['1', '1'],
['null', 'null'], ['null', 'null'],
['"&"', '"\u0026"'], ['"&"', '"\u0026"'],
['"</script>"', '"\u003C/script\u003E"'], ['"</script>"', '"\u003c/script\u003e"'],
['["</script>"]', '["\u003C/script\u003E"]'], ['["</script>"]', '["\u003c/script\u003e"]'],
['{"name":"</script>"}', '{"name":"\u003C/script\u003E"}'] ['{"name":"</script>"}', '{"name":"\u003c/script\u003e"}']
] ]


def test_html_escape def test_html_escape
Expand Down
Expand Up @@ -4,7 +4,7 @@
class ERB class ERB
module Util module Util
HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' } 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+));)/ HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+));)/
JSON_ESCAPE_REGEXP = /[&><]/ JSON_ESCAPE_REGEXP = /[&><]/


Expand Down

0 comments on commit c229c7a

Please sign in to comment.