Fix #3225: Exception in NoteSanitizer#relativize_links.

This commit is contained in:
evazion
2017-07-19 21:13:04 -05:00
parent 8dafa15069
commit 1fe6a5fc65
2 changed files with 10 additions and 4 deletions

View File

@@ -28,5 +28,10 @@ class NoteSanitizerTest < ActiveSupport::TestCase
body = '<a href="http://sonohara.donmai.us/posts?tags=touhou#dtext-intro">touhou</a>'
assert_equal('<a href="/posts?tags=touhou#dtext-intro" rel="nofollow">touhou</a>', NoteSanitizer.sanitize(body))
end
should "not fail when rewriting bad links" do
body = %{<a href ="\nhttp!://www.google.com:12x3">google</a>}
assert_equal(%{<a rel="nofollow">google</a>}, NoteSanitizer.sanitize(body))
end
end
end