loofah 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of loofah might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/CHANGELOG.rdoc +18 -0
- data/MIT-LICENSE.txt +21 -0
- data/Manifest.txt +28 -0
- data/README.rdoc +110 -0
- data/Rakefile +16 -0
- data/TODO.rdoc +9 -0
- data/benchmark/benchmark.rb +72 -0
- data/benchmark/fragment.html +96 -0
- data/benchmark/www.slashdot.com.html +2560 -0
- data/init.rb +2 -0
- data/lib/loofah.rb +197 -0
- data/lib/loofah/active_record.rb +44 -0
- data/lib/loofah/deprecated.rb +38 -0
- data/lib/loofah/html/document.rb +19 -0
- data/lib/loofah/html/document_fragment.rb +30 -0
- data/lib/loofah/html5/scrub.rb +70 -0
- data/lib/loofah/html5/whitelist.rb +170 -0
- data/lib/loofah/scrubber.rb +108 -0
- data/test/helper.rb +8 -0
- data/test/html5/test_deprecated_sanitizer.rb +185 -0
- data/test/html5/test_sanitizer.rb +245 -0
- data/test/html5/testdata/tests1.dat +501 -0
- data/test/test_active_record.rb +71 -0
- data/test/test_api.rb +51 -0
- data/test/test_deprecated_basic.rb +68 -0
- data/test/test_microsofty.rb +91 -0
- data/test/test_scrubber.rb +100 -0
- data/test/test_strip_tags.rb +36 -0
- metadata +148 -0
- metadata.gz.sig +0 -0
@@ -0,0 +1,71 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
require 'loofah/active_record'
|
4
|
+
|
5
|
+
class TestActiveRecord < Test::Unit::TestCase
|
6
|
+
|
7
|
+
HTML_STRING = "<div>omgwtfbbq</div>"
|
8
|
+
PLAIN_TEXT = "vanilla text"
|
9
|
+
|
10
|
+
context "with a Post model" do
|
11
|
+
|
12
|
+
setup do
|
13
|
+
ActsAsFu.build_model(:posts) do
|
14
|
+
string :plain_text
|
15
|
+
string :html_string
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context "scrubbing field as a fragment" do
|
20
|
+
setup do
|
21
|
+
Post.html_fragment :html_string, :scrub => :prune
|
22
|
+
@post = Post.new :html_string => HTML_STRING, :plain_text => PLAIN_TEXT
|
23
|
+
end
|
24
|
+
|
25
|
+
should "scrub the specified field" do
|
26
|
+
Loofah.expects(:scrub_fragment).with(HTML_STRING, :prune).once
|
27
|
+
Loofah.expects(:scrub_fragment).with(PLAIN_TEXT, :prune).never
|
28
|
+
@post.save
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context "scrubbing field as a document" do
|
33
|
+
setup do
|
34
|
+
Post.html_document :html_string, :scrub => :strip
|
35
|
+
@post = Post.new :html_string => HTML_STRING, :plain_text => PLAIN_TEXT
|
36
|
+
end
|
37
|
+
|
38
|
+
should "scrub the specified field, but not other fields" do
|
39
|
+
Loofah.expects(:scrub_document).with(HTML_STRING, :strip).once
|
40
|
+
Loofah.expects(:scrub_document).with(PLAIN_TEXT, :strip).never
|
41
|
+
@post.save
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
context "not passing any options" do
|
46
|
+
should "raise ArgumentError" do
|
47
|
+
assert_raises(ArgumentError) {
|
48
|
+
Post.html_fragment :foo
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "not passing :scrub option" do
|
54
|
+
should "raise ArgumentError" do
|
55
|
+
assert_raise(ArgumentError) {
|
56
|
+
Post.html_fragment :foo, :bar => :quux
|
57
|
+
}
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "passing a :scrub option" do
|
62
|
+
should "not raise ArgumentError" do
|
63
|
+
assert_nothing_raised {
|
64
|
+
Post.html_fragment :foo, :scrub => :quux
|
65
|
+
}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
data/test/test_api.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
class TestApi < Test::Unit::TestCase
|
4
|
+
|
5
|
+
HTML = "<div>a</div>\n<div>b</div>"
|
6
|
+
|
7
|
+
def test_loofah_document
|
8
|
+
doc = Loofah.document(HTML)
|
9
|
+
assert_html_documentish doc
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_loofah_fragment
|
13
|
+
doc = Loofah.fragment(HTML)
|
14
|
+
assert_html_fragmentish doc
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_loofah_html_document_parse_method
|
18
|
+
doc = Loofah::HTML::Document.parse(HTML)
|
19
|
+
assert_html_documentish doc
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_loofah_html_document_fragment_parse_method
|
23
|
+
doc = Loofah::HTML::DocumentFragment.parse(HTML)
|
24
|
+
assert_html_fragmentish doc
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_loofah_document_scrub!
|
28
|
+
doc = Loofah.document(HTML).scrub!(:strip)
|
29
|
+
assert_html_documentish doc
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_loofah_fragment_scrub!
|
33
|
+
doc = Loofah.fragment(HTML).scrub!(:strip)
|
34
|
+
assert_html_fragmentish doc
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def assert_html_documentish(doc)
|
40
|
+
assert_kind_of Nokogiri::HTML::Document, doc
|
41
|
+
assert_kind_of Loofah::HTML::Document, doc
|
42
|
+
assert_equal HTML, doc.xpath("/html/body").inner_html
|
43
|
+
end
|
44
|
+
|
45
|
+
def assert_html_fragmentish(doc)
|
46
|
+
assert_kind_of Nokogiri::HTML::DocumentFragment, doc
|
47
|
+
assert_kind_of Loofah::HTML::DocumentFragment, doc
|
48
|
+
assert_equal HTML, doc.inner_html
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
class TestDeprecatedBasic < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_empty_string
|
6
|
+
assert_equal "", Loofah.sanitize("")
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_removal_of_illegal_tag
|
10
|
+
html = <<-HTML
|
11
|
+
following this there should be no jim tag
|
12
|
+
<jim>jim</jim>
|
13
|
+
was there?
|
14
|
+
HTML
|
15
|
+
sane = Nokogiri::HTML(Loofah.sanitize(html))
|
16
|
+
assert sane.xpath("//jim").empty?
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_removal_of_illegal_attribute
|
20
|
+
html = "<p class=bar foo=bar abbr=bar />"
|
21
|
+
sane = Nokogiri::HTML(Loofah.sanitize(html))
|
22
|
+
node = sane.xpath("//p").first
|
23
|
+
assert node.attributes['class']
|
24
|
+
assert node.attributes['abbr']
|
25
|
+
assert_nil node.attributes['foo']
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_removal_of_illegal_url_in_href
|
29
|
+
html = <<-HTML
|
30
|
+
<a href='jimbo://jim.jim/'>this link should have its href removed because of illegal url</a>
|
31
|
+
<a href='http://jim.jim/'>this link should be fine</a>
|
32
|
+
HTML
|
33
|
+
sane = Nokogiri::HTML(Loofah.sanitize(html))
|
34
|
+
nodes = sane.xpath("//a")
|
35
|
+
assert_nil nodes.first.attributes['href']
|
36
|
+
assert nodes.last.attributes['href']
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_css_sanitization
|
40
|
+
html = "<p style='background-color: url(\"http://foo.com/\") ; background-color: #000 ;' />"
|
41
|
+
sane = Nokogiri::HTML(Loofah.sanitize(html))
|
42
|
+
assert_match(/#000/, sane.inner_html)
|
43
|
+
assert_no_match(/foo\.com/, sane.inner_html)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_fragment_with_no_tags
|
47
|
+
assert_equal "This fragment has no tags.", Loofah.sanitize("This fragment has no tags.")
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_fragment_in_p_tag
|
51
|
+
assert_equal "<p>This fragment is in a p.</p>", Loofah.sanitize("<p>This fragment is in a p.</p>")
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_fragment_in_p_tag_plus_stuff
|
55
|
+
assert_equal "<p>This fragment is in a p.</p>foo<strong>bar</strong>", Loofah.sanitize("<p>This fragment is in a p.</p>foo<strong>bar</strong>")
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_fragment_with_text_nodes_leading_and_trailing
|
59
|
+
assert_equal "text<p>fragment</p>text", Loofah.sanitize("text<p>fragment</p>text")
|
60
|
+
end
|
61
|
+
|
62
|
+
def test_whitewash_on_fragment
|
63
|
+
html = "safe<frameset rows=\"*\"><frame src=\"http://example.com\"></frameset> <b>description</b>"
|
64
|
+
whitewashed = Loofah.whitewash_document(html)
|
65
|
+
assert_equal "<p>safe</p><b>description</b>", whitewashed.gsub("\n","")
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
class TestMicrosofty < Test::Unit::TestCase
|
4
|
+
|
5
|
+
MSWORD_HTML = <<-EOHTML
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 11"><meta name="Originator" content="Microsoft Word 11"><link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CNICOLE%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"><!--[if gte mso 9]><xml>
|
7
|
+
<w:WordDocument>
|
8
|
+
<w:View>Normal</w:View>
|
9
|
+
<w:Zoom>0</w:Zoom>
|
10
|
+
<w:PunctuationKerning/>
|
11
|
+
<w:ValidateAgainstSchemas/>
|
12
|
+
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
|
13
|
+
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
|
14
|
+
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
|
15
|
+
<w:Compatibility>
|
16
|
+
<w:BreakWrappedTables/>
|
17
|
+
<w:SnapToGridInCell/>
|
18
|
+
<w:WrapTextWithPunct/>
|
19
|
+
<w:UseAsianBreakRules/>
|
20
|
+
<w:DontGrowAutofit/>
|
21
|
+
</w:Compatibility>
|
22
|
+
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
|
23
|
+
</w:WordDocument>
|
24
|
+
</xml><![endif]--><!--[if gte mso 9]><xml>
|
25
|
+
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
|
26
|
+
</w:LatentStyles>
|
27
|
+
</xml><![endif]--><style>
|
28
|
+
<!--
|
29
|
+
/* Style Definitions */
|
30
|
+
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
31
|
+
{mso-style-parent:"";
|
32
|
+
margin:0in;
|
33
|
+
margin-bottom:.0001pt;
|
34
|
+
mso-pagination:widow-orphan;
|
35
|
+
font-size:12.0pt;
|
36
|
+
font-family:"Times New Roman";
|
37
|
+
mso-fareast-font-family:"Times New Roman";}
|
38
|
+
@page Section1
|
39
|
+
{size:8.5in 11.0in;
|
40
|
+
margin:1.0in 1.25in 1.0in 1.25in;
|
41
|
+
mso-header-margin:.5in;
|
42
|
+
mso-footer-margin:.5in;
|
43
|
+
mso-paper-source:0;}
|
44
|
+
div.Section1
|
45
|
+
{page:Section1;}
|
46
|
+
-->
|
47
|
+
</style><!--[if gte mso 10]>
|
48
|
+
<style>
|
49
|
+
/* Style Definitions */
|
50
|
+
table.MsoNormalTable
|
51
|
+
{mso-style-name:"Table Normal";
|
52
|
+
mso-tstyle-rowband-size:0;
|
53
|
+
mso-tstyle-colband-size:0;
|
54
|
+
mso-style-noshow:yes;
|
55
|
+
mso-style-parent:"";
|
56
|
+
mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
57
|
+
mso-para-margin:0in;
|
58
|
+
mso-para-margin-bottom:.0001pt;
|
59
|
+
mso-pagination:widow-orphan;
|
60
|
+
font-size:10.0pt;
|
61
|
+
font-family:"Times New Roman";
|
62
|
+
mso-ansi-language:#0400;
|
63
|
+
mso-fareast-language:#0400;
|
64
|
+
mso-bidi-language:#0400;}
|
65
|
+
</style>
|
66
|
+
<![endif]-->
|
67
|
+
|
68
|
+
<p class="MsoNormal">Foo <b style="">BOLD<o:p></o:p></b></p>
|
69
|
+
EOHTML
|
70
|
+
|
71
|
+
def test_deprecated_whitewash_fragment_on_microsofty_markup
|
72
|
+
whitewashed = Loofah.whitewash(MSWORD_HTML.chomp)
|
73
|
+
assert_equal "<p>Foo <b>BOLD</b></p>", whitewashed
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_deprecated_whitewash_on_microsofty_markup
|
77
|
+
whitewashed = Loofah.whitewash_document(MSWORD_HTML)
|
78
|
+
assert_equal "<p>Foo <b>BOLD</b></p>", whitewashed
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_fragment_whitewash_on_microsofty_markup
|
82
|
+
whitewashed = Loofah.fragment(MSWORD_HTML.chomp).scrub!(:whitewash)
|
83
|
+
assert_equal "<p>Foo <b>BOLD</b></p>", whitewashed.to_s
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_document_whitewash_on_microsofty_markup
|
87
|
+
whitewashed = Loofah.document(MSWORD_HTML.chomp).scrub!(:whitewash)
|
88
|
+
assert_equal "<p>Foo <b>BOLD</b></p>", whitewashed.to_s
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
class TestScrubber < Test::Unit::TestCase
|
4
|
+
|
5
|
+
[ Loofah::HTML::Document, Loofah::HTML::DocumentFragment ].each do |klass|
|
6
|
+
define_method "test_#{klass}_bad_sanitize_method" do
|
7
|
+
doc = klass.parse "<p>foo</p>"
|
8
|
+
assert_raises(ArgumentError) { doc.scrub! :frippery }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
INVALID_FRAGMENT = "<invalid>foo<p>bar</p>bazz</invalid><div>quux</div>"
|
13
|
+
INVALID_ESCAPED = "<invalid>foo<p>bar</p>bazz</invalid><div>quux</div>"
|
14
|
+
INVALID_PRUNED = "<div>quux</div>"
|
15
|
+
INVALID_STRIPPED = "foo<p>bar</p>bazz<div>quux</div>"
|
16
|
+
|
17
|
+
WHITEWASH_FRAGMENT = "<o:div>no</o:div><div id='no'>foo</div><invalid>bar</invalid>"
|
18
|
+
WHITEWASH_RESULT = "<div>foo</div>"
|
19
|
+
|
20
|
+
def test_document_escape_bad_tags
|
21
|
+
doc = Loofah::HTML::Document.parse "<html><body>#{INVALID_FRAGMENT}</body></html>"
|
22
|
+
result = doc.scrub! :escape
|
23
|
+
|
24
|
+
assert_equal INVALID_ESCAPED, doc.xpath('/html/body').inner_html
|
25
|
+
assert_equal doc, result
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_fragment_escape_bad_tags
|
29
|
+
doc = Loofah::HTML::DocumentFragment.parse "<div>#{INVALID_FRAGMENT}</div>"
|
30
|
+
result = doc.scrub! :escape
|
31
|
+
|
32
|
+
assert_equal INVALID_ESCAPED, doc.xpath("./div").inner_html
|
33
|
+
assert_equal doc, result
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_document_prune_bad_tags
|
37
|
+
doc = Loofah::HTML::Document.parse "<html><body>#{INVALID_FRAGMENT}</body></html>"
|
38
|
+
result = doc.scrub! :prune
|
39
|
+
|
40
|
+
assert_equal INVALID_PRUNED, doc.xpath('/html/body').inner_html
|
41
|
+
assert_equal doc, result
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_fragment_prune_bad_tags
|
45
|
+
doc = Loofah::HTML::DocumentFragment.parse "<div>#{INVALID_FRAGMENT}</div>"
|
46
|
+
result = doc.scrub! :prune
|
47
|
+
|
48
|
+
assert_equal INVALID_PRUNED, doc.xpath("./div").inner_html
|
49
|
+
assert_equal doc, result
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_document_strip_bad_tags
|
53
|
+
doc = Loofah::HTML::Document.parse "<html><body>#{INVALID_FRAGMENT}</body></html>"
|
54
|
+
result = doc.scrub! :strip
|
55
|
+
|
56
|
+
assert_equal INVALID_STRIPPED, doc.xpath('/html/body').inner_html
|
57
|
+
assert_equal doc, result
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_fragment_strip_bad_tags
|
61
|
+
doc = Loofah::HTML::DocumentFragment.parse "<div>#{INVALID_FRAGMENT}</div>"
|
62
|
+
result = doc.scrub! :strip
|
63
|
+
|
64
|
+
assert_equal INVALID_STRIPPED, doc.xpath("./div").inner_html
|
65
|
+
assert_equal doc, result
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_document_whitewash
|
69
|
+
doc = Loofah::HTML::Document.parse "<html><body>#{WHITEWASH_FRAGMENT}</body></html>"
|
70
|
+
result = doc.scrub! :whitewash
|
71
|
+
|
72
|
+
assert_equal WHITEWASH_RESULT, doc.xpath('/html/body').inner_html
|
73
|
+
assert_equal doc, result
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_fragment_whitewash
|
77
|
+
doc = Loofah::HTML::DocumentFragment.parse "<div>#{WHITEWASH_FRAGMENT}</div>"
|
78
|
+
result = doc.scrub! :whitewash
|
79
|
+
|
80
|
+
assert_equal WHITEWASH_RESULT, doc.xpath("./div").inner_html
|
81
|
+
assert_equal doc, result
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_fragment_shortcut
|
85
|
+
doc = mock
|
86
|
+
Loofah.expects(:fragment).with(:string_or_io).returns(doc)
|
87
|
+
doc.expects(:scrub!).with(:method)
|
88
|
+
|
89
|
+
Loofah.scrub_fragment(:string_or_io, :method)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_document_shortcut
|
93
|
+
doc = mock
|
94
|
+
Loofah.expects(:document).with(:string_or_io).returns(doc)
|
95
|
+
doc.expects(:scrub!).with(:method)
|
96
|
+
|
97
|
+
Loofah.scrub_document(:string_or_io, :method)
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
|
2
|
+
|
3
|
+
class TestStripTags < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def test_empty_string
|
6
|
+
assert_equal Loofah.strip_tags(""), ""
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_return_empty_string_when_nothing_left
|
10
|
+
assert_equal "", Loofah.strip_tags('<script>test</script>')
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_removal_of_all_tags
|
14
|
+
html = <<-HTML
|
15
|
+
What's up <strong>doc</strong>?
|
16
|
+
HTML
|
17
|
+
stripped = Loofah.strip_tags(html)
|
18
|
+
assert_equal "What's up doc?".strip, stripped.strip
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_dont_remove_whitespace
|
22
|
+
html = "Foo\nBar"
|
23
|
+
assert_equal html, Loofah.strip_tags(html)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_dont_remove_whitespace_between_tags
|
27
|
+
html = "<p>Foo</p>\n<p>Bar</p>"
|
28
|
+
assert_equal "Foo\nBar", Loofah.strip_tags(html)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_removal_of_entities
|
32
|
+
html = "<p>this is < that "&" the other > boo'ya</p>"
|
33
|
+
assert_equal 'this is < that "&" the other > boo\'ya', Loofah.strip_tags(html)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: loofah
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike Dalessio
|
8
|
+
- Bryan Helmkamp
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain:
|
12
|
+
- |
|
13
|
+
-----BEGIN CERTIFICATE-----
|
14
|
+
MIIDPDCCAiSgAwIBAgIBADANBgkqhkiG9w0BAQUFADBEMRYwFAYDVQQDDA1taWtl
|
15
|
+
LmRhbGVzc2lvMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
|
16
|
+
FgNjb20wHhcNMDkwODExMDU0MjQ5WhcNMTAwODExMDU0MjQ5WjBEMRYwFAYDVQQD
|
17
|
+
DA1taWtlLmRhbGVzc2lvMRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJ
|
18
|
+
k/IsZAEZFgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDANjr7
|
19
|
+
lZ1DKtK8YvNp+5kBzIpwrpClHRrosqo01qmWfGBxZckQUtrJUwGPxpzvIHVq1VKp
|
20
|
+
a9FXU/QWYek/1S0vhkOf9XGmFBnVCtbJhwGeyzsQFFSoQIfs2hd5gO0dSRpuKdi3
|
21
|
+
slfJAXzFKg1u/7OCVPgrY/mkdh34MzL5p0gSDzPt7vLPibctHg0GoepYT5Fh1tMQ
|
22
|
+
luzgrN0weTw/QoEWTMQcNk6CyUpzv0pOe7d0qEPQ9Lx7Lz64gIym3f0pKFpWLfME
|
23
|
+
l7PFLeR95zw2zsuZQwCR5ma5zjXD3mo2jk1mVqiI8qplOL1u30FU7hRhTV5n/Qe9
|
24
|
+
elDQoZW9Xz0R5JGDAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0G
|
25
|
+
A1UdDgQWBBRXWlUJZXcR1jkZPE24+mjUTCqNxjANBgkqhkiG9w0BAQUFAAOCAQEA
|
26
|
+
jDh5M41sg1MZKG1DXzQmo/IADeWRmXyb3EZaED9lhFFpoQqaralgpgmvuc0GswvO
|
27
|
+
QIZijh03tPQz8lgp1U1OFZod2ZwbEVTtVZpxs1ssjMraOA6KzlsNROH0XonIiy6j
|
28
|
+
r2Q0UF35ax8pvr3D5Y6AKzIW1F3aeiREylUDJlb/i1dPQ2PVK0yRrSQoK2epwM9E
|
29
|
+
zoczlHTTJc/tRvH5Up3Agcv9y+J0U9a1Af9NRsnHPVBdo2H32MsJ99x5NRDWJmJg
|
30
|
+
ohH37UR7njcc6j4fo22IwTqXaaXJdtVdAWjXP/xs5B3cPYSP6uqFnR46Jf86Iqj1
|
31
|
+
FlqnTjy13J3nD30uxy9a1g==
|
32
|
+
-----END CERTIFICATE-----
|
33
|
+
|
34
|
+
date: 2009-08-11 00:00:00 -04:00
|
35
|
+
default_executable:
|
36
|
+
dependencies:
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: nokogiri
|
39
|
+
type: :runtime
|
40
|
+
version_requirement:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.3.3
|
46
|
+
version:
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: hoe
|
49
|
+
type: :development
|
50
|
+
version_requirement:
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 2.3.3
|
56
|
+
version:
|
57
|
+
description: |-
|
58
|
+
Loofah is an HTML sanitizer. It will *always* fix broken markup, but
|
59
|
+
can also sanitize unsafe tags in a few different ways, and transform
|
60
|
+
the markup for storage or display.
|
61
|
+
|
62
|
+
It's built on top of Nokogiri and libxml2, so it's fast. And it uses
|
63
|
+
html5lib's whitelist, so it most likely won't make your codes less
|
64
|
+
secure.
|
65
|
+
|
66
|
+
(These statements have not been evaluated by Internet Experts.)
|
67
|
+
|
68
|
+
This library was formerly known as Dryopteris.
|
69
|
+
email:
|
70
|
+
- mike.dalessio@gmail.com
|
71
|
+
- bryan@brynary.com
|
72
|
+
executables: []
|
73
|
+
|
74
|
+
extensions: []
|
75
|
+
|
76
|
+
extra_rdoc_files:
|
77
|
+
- MIT-LICENSE.txt
|
78
|
+
- Manifest.txt
|
79
|
+
- TODO.rdoc
|
80
|
+
- CHANGELOG.rdoc
|
81
|
+
- README.rdoc
|
82
|
+
files:
|
83
|
+
- CHANGELOG.rdoc
|
84
|
+
- MIT-LICENSE.txt
|
85
|
+
- Manifest.txt
|
86
|
+
- README.rdoc
|
87
|
+
- Rakefile
|
88
|
+
- TODO.rdoc
|
89
|
+
- benchmark/benchmark.rb
|
90
|
+
- benchmark/fragment.html
|
91
|
+
- benchmark/www.slashdot.com.html
|
92
|
+
- init.rb
|
93
|
+
- lib/loofah.rb
|
94
|
+
- lib/loofah/active_record.rb
|
95
|
+
- lib/loofah/deprecated.rb
|
96
|
+
- lib/loofah/html/document.rb
|
97
|
+
- lib/loofah/html/document_fragment.rb
|
98
|
+
- lib/loofah/html5/scrub.rb
|
99
|
+
- lib/loofah/html5/whitelist.rb
|
100
|
+
- lib/loofah/scrubber.rb
|
101
|
+
- test/helper.rb
|
102
|
+
- test/html5/test_deprecated_sanitizer.rb
|
103
|
+
- test/html5/test_sanitizer.rb
|
104
|
+
- test/html5/testdata/tests1.dat
|
105
|
+
- test/test_active_record.rb
|
106
|
+
- test/test_api.rb
|
107
|
+
- test/test_deprecated_basic.rb
|
108
|
+
- test/test_microsofty.rb
|
109
|
+
- test/test_scrubber.rb
|
110
|
+
- test/test_strip_tags.rb
|
111
|
+
has_rdoc: true
|
112
|
+
homepage: http://rubyforge.org/projects/loofah
|
113
|
+
licenses: []
|
114
|
+
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options:
|
117
|
+
- --main
|
118
|
+
- README.rdoc
|
119
|
+
require_paths:
|
120
|
+
- lib
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ">="
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: "0"
|
126
|
+
version:
|
127
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: "0"
|
132
|
+
version:
|
133
|
+
requirements: []
|
134
|
+
|
135
|
+
rubyforge_project: loofah
|
136
|
+
rubygems_version: 1.3.5
|
137
|
+
signing_key:
|
138
|
+
specification_version: 3
|
139
|
+
summary: Loofah is an HTML sanitizer
|
140
|
+
test_files:
|
141
|
+
- test/test_deprecated_basic.rb
|
142
|
+
- test/test_scrubber.rb
|
143
|
+
- test/test_strip_tags.rb
|
144
|
+
- test/test_api.rb
|
145
|
+
- test/html5/test_sanitizer.rb
|
146
|
+
- test/html5/test_deprecated_sanitizer.rb
|
147
|
+
- test/test_active_record.rb
|
148
|
+
- test/test_microsofty.rb
|