Make Sanitizer::safe_xhtml_sanitize use Nokogiri
Also, update Bundler to 1.0.18.
This commit is contained in:
parent
4b2448b09a
commit
1e352e28a1
163 changed files with 1216 additions and 255 deletions
|
@ -26,19 +26,27 @@ class NoWikiTest < Test::Unit::TestCase
|
|||
|
||||
def test_sanitize_nowiki
|
||||
match(NoWiki, 'This sentence contains <nowiki>[[test]]&<a href="a&b">shebang</a> <script>alert("xss!");</script> *foo*</nowiki>. Do not touch!',
|
||||
:plain_text => "[[test]]&<a href='a&b'>shebang</a> <script>alert("xss!");</script> *foo*"
|
||||
:plain_text => "[[test]]&<a href=\"a&b\">shebang</a> <script>alert(\"xss!\");</script> *foo*"
|
||||
)
|
||||
end
|
||||
|
||||
# Here, the input is not namespace-well-formed, but the output is.
|
||||
# I think that's OK.
|
||||
def test_sanitize_nowiki_ill_formed
|
||||
match(NoWiki, "<nowiki><animateColor xlink:href='#foo'/></nowiki>",
|
||||
:plain_text => "<animateColor xlink:href='#foo'/>"
|
||||
:plain_text => '<animateColor href="#foo"/>'
|
||||
)
|
||||
end
|
||||
|
||||
def test_sanitize_nowiki_ill_formed_II
|
||||
match(NoWiki, "<nowiki><animateColor xlink:href='#foo'/>\000</nowiki>",
|
||||
:plain_text => %(<animateColor xlink:href='#foo'/>)
|
||||
:plain_text => '<animateColor href="#foo"/>'
|
||||
)
|
||||
end
|
||||
|
||||
def test_sanitize_nowiki_ill_formed_III
|
||||
match(NoWiki, "<nowiki><animateColor xlink:href='#foo' xmlns:xlink='http://www.w3.org/1999/xlink'/>\000</nowiki>",
|
||||
:plain_text => '<animateColor xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#foo"/>'
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue