@@ -58,11 +58,11 @@ def test_strip_tags_with_quote
58
58
end
59
59
60
60
def test_strip_invalid_html
61
- assert_equal "" , full_sanitize ( "<<<bad html" )
61
+ assert_equal "<< " , full_sanitize ( "<<<bad html" )
62
62
end
63
63
64
64
def test_strip_nested_tags
65
- expected = "Weia onclick='alert(document.cookie);'/>rdos"
65
+ expected = "Wei<a onclick='alert(document.cookie);'/>rdos"
66
66
input = "Wei<<a>a onclick='alert(document.cookie);'</a>/>rdos"
67
67
assert_equal expected , full_sanitize ( input )
68
68
end
@@ -98,8 +98,8 @@ def test_strip_tags_with_tags
98
98
assert_equal "This is a test." , full_sanitize ( "<p>This <u>is<u> a <a href='test.html'><strong>test</strong></a>.</p>" )
99
99
end
100
100
101
- def test_strip_tags_with_many_open_quotes
102
- assert_equal "" , full_sanitize ( "<<<bad html>" )
101
+ def test_escape_tags_with_many_open_quotes
102
+ assert_equal "<< " , full_sanitize ( "<<<bad html>" )
103
103
end
104
104
105
105
def test_strip_tags_with_sentence
@@ -123,7 +123,7 @@ def test_full_sanitize_respect_html_escaping_of_the_given_string
123
123
end
124
124
125
125
def test_strip_links_with_tags_in_tags
126
- expected = "a href='hello'>all <b>day</b> long/a>"
126
+ expected = "< a href='hello'>all <b>day</b> long< /a>"
127
127
input = "<<a>a href='hello'>all <b>day</b> long<</A>/a>"
128
128
assert_equal expected , link_sanitize ( input )
129
129
end
@@ -360,7 +360,7 @@ def test_should_sanitize_invalid_script_tag
360
360
end
361
361
362
362
def test_should_sanitize_script_tag_with_multiple_open_brackets
363
- assert_sanitized %(<<SCRIPT>alert("XSS");//<</SCRIPT>) , "alert(\" XSS\" );//"
363
+ assert_sanitized %(<<SCRIPT>alert("XSS");//<</SCRIPT>) , "< alert(\" XSS\" );//< "
364
364
assert_sanitized %(<iframe src=http://ha.ckers.org/scriptlet.html\n <a) , ""
365
365
end
366
366
0 commit comments