mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use lower case letters in unicodes sequences to match the new encoder's output
This commit is contained in:
parent
2f1c5789c1
commit
c229c7a39c
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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 = /[&><]/
|
||||
|
||||
|
|
Loading…
Reference in a new issue