File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module Escaper
33 class << self
44
55 GON_JS_ESCAPE_MAP = {
6- '</' => '<\ /'
6+ '</' => '\u003C /'
77 }
88
99 def escape ( javascript )
Original file line number Diff line number Diff line change 6060 it 'outputs correct js with a script string' do
6161 Gon . str = %q(</script><script>alert('!')</script>)
6262 @base . include_gon . should == '<script>window.gon = {};' +
63- %q(gon.str="<\\ /script><script>alert('!')<\\ /script>";) +
63+ %q(gon.str="\\u003C /script><script>alert('!')\\u003C /script>";) +
6464 '</script>'
6565 end
6666
Original file line number Diff line number Diff line change 7272 it 'outputs correct js with a script string' do
7373 Gon . global . str = %q(</script><script>alert('!')</script>)
7474 @base . include_gon . should == "<script>window.gon = {};" +
75- "gon.global={\" str\" :\" < \\ /script><script>alert('!')< \\ /script>\" };" +
75+ "gon.global={\" str\" :\" \\ u003C /script><script>alert('!')\\ u003C /script>\" };" +
7676 "</script>"
7777 end
7878
You can’t perform that action at this time.
0 commit comments