loofah 2.0.0 → 2.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +12 -0
- data/README.rdoc +7 -7
- data/lib/loofah.rb +1 -1
- data/lib/loofah/html5/scrub.rb +7 -3
- data/test/helper.rb +1 -1
- metadata +31 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3ca2dd3ffb1e1d31dd08731c8540f8259f29228
|
4
|
+
data.tar.gz: 515eb47e23c9b138d840ff71b3ccca78c243b642
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80380e9954da98bfbdb1dae7c57bc334cfd9571b316130def5c936a25ad5de65676bd698eeb419709db1e9fe853b7717eafca50186e61c0dead6155cefbb4460
|
7
|
+
data.tar.gz: 3ba02c8f6141ec3f77edf1a6980df378dc8a0d56d0ee117d63c4c22a6969b9a4a3cd749591f65b13f3b84b06e854b6f6f3a11c83b98c01c656fbb0a190c5911f
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
|
+
== 2.0.1 / 2014-08-21
|
4
|
+
|
5
|
+
Bug fixes:
|
6
|
+
|
7
|
+
* Load RR correctly when running test files directly. (Thanks, @ktdreyer!)
|
8
|
+
|
9
|
+
|
10
|
+
Notes:
|
11
|
+
|
12
|
+
* Extracted HTML5::Scrub#scrub_css_attribute to accommodate the Rails integration work. (Thanks, @kaspth!)
|
13
|
+
|
14
|
+
|
3
15
|
== 2.0.0 / 2014-05-09
|
4
16
|
|
5
17
|
Compatibility notes:
|
data/README.rdoc
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
= Loofah {<img src="https://travis-ci.org/flavorjones/loofah.png?branch=master" alt="Build Status" />}[https://travis-ci.org/flavorjones/loofah]
|
2
2
|
|
3
|
-
*
|
3
|
+
* https://github.com/flavorjones/loofah
|
4
4
|
* http://rubydoc.info/github/flavorjones/loofah/master/frames
|
5
5
|
* http://librelist.com/browser/loofah
|
6
6
|
|
@@ -17,7 +17,7 @@ not been evaluated by Netexperts.)
|
|
17
17
|
|
18
18
|
ActiveRecord extensions for sanitization are available in the
|
19
19
|
`loofah-activerecord` gem (see
|
20
|
-
|
20
|
+
https://github.com/flavorjones/loofah-activerecord).
|
21
21
|
|
22
22
|
== Features
|
23
23
|
|
@@ -43,7 +43,7 @@ Loofah works on XML, XHTML and HTML documents.
|
|
43
43
|
Also, it's pretty fast. Here is a benchmark comparing Loofah to other
|
44
44
|
commonly-used libraries (ActionView, Sanitize, HTML5lib and HTMLfilter):
|
45
45
|
|
46
|
-
*
|
46
|
+
* https://gist.github.com/170193
|
47
47
|
|
48
48
|
Lastly, Loofah is extensible. It's super-easy to write your own custom
|
49
49
|
scrubbers for whatever document manipulation you need. You don't like
|
@@ -249,7 +249,7 @@ Unsurprisingly:
|
|
249
249
|
|
250
250
|
The bug tracker is available here:
|
251
251
|
|
252
|
-
*
|
252
|
+
* https://github.com/flavorjones/loofah/issues
|
253
253
|
|
254
254
|
And the mailing list is on librelist:
|
255
255
|
|
@@ -261,11 +261,11 @@ And the IRC channel is \#loofah on freenode.
|
|
261
261
|
|
262
262
|
* Nokogiri: http://nokogiri.org
|
263
263
|
* libxml2: http://xmlsoft.org
|
264
|
-
* html5lib:
|
264
|
+
* html5lib: https://code.google.com/p/html5lib
|
265
265
|
|
266
266
|
== Authors
|
267
267
|
|
268
|
-
* {Mike Dalessio}[http://mike.daless.io] (@flavorjones[
|
268
|
+
* {Mike Dalessio}[http://mike.daless.io] (@flavorjones[https://twitter.com/flavorjones])
|
269
269
|
* Bryan Helmkamp
|
270
270
|
|
271
271
|
Featuring code contributed by:
|
@@ -280,7 +280,7 @@ And a big shout-out to Corey Innis for the name, and feedback on the API.
|
|
280
280
|
|
281
281
|
== Thank You
|
282
282
|
|
283
|
-
The following people have generously donated via the Pledgie[http://pledgie.com] badge on the {Loofah github page}[
|
283
|
+
The following people have generously donated via the Pledgie[http://pledgie.com] badge on the {Loofah github page}[https://github.com/flavorjones/loofah]:
|
284
284
|
|
285
285
|
* Bill Harding
|
286
286
|
|
data/lib/loofah.rb
CHANGED
data/lib/loofah/html5/scrub.rb
CHANGED
@@ -48,15 +48,19 @@ module Loofah
|
|
48
48
|
next
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
52
|
-
|
53
|
-
end
|
51
|
+
|
52
|
+
scrub_css_attribute node
|
54
53
|
|
55
54
|
node.attribute_nodes.each do |attr_node|
|
56
55
|
node.remove_attribute(attr_node.name) if attr_node.value !~ /[^[:space:]]/
|
57
56
|
end
|
58
57
|
end
|
59
58
|
|
59
|
+
def scrub_css_attribute node
|
60
|
+
style = node.attributes['style']
|
61
|
+
style.value = scrub_css(style.value) if style
|
62
|
+
end
|
63
|
+
|
60
64
|
# lifted nearly verbatim from html5lib
|
61
65
|
def scrub_css style
|
62
66
|
# disallow urls
|
data/test/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loofah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -9,160 +9,160 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 1.5.9
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.5.9
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rdoc
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - ~>
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '4.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - ~>
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '4.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0.8'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0.8'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: minitest
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - ~>
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '2.2'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '2.2'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rr
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ~>
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: 1.1.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: 1.1.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: json
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: hoe-gemspec
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
|
-
- -
|
102
|
+
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
type: :development
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: hoe-debugging
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- -
|
116
|
+
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
type: :development
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
|
-
- -
|
123
|
+
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: hoe-bundler
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
|
-
- -
|
130
|
+
- - ">="
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
type: :development
|
134
134
|
prerelease: false
|
135
135
|
version_requirements: !ruby/object:Gem::Requirement
|
136
136
|
requirements:
|
137
|
-
- -
|
137
|
+
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
- !ruby/object:Gem::Dependency
|
141
141
|
name: hoe-git
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
143
143
|
requirements:
|
144
|
-
- -
|
144
|
+
- - ">="
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
type: :development
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
|
-
- -
|
151
|
+
- - ">="
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: '0'
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: hoe
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
157
157
|
requirements:
|
158
|
-
- - ~>
|
158
|
+
- - "~>"
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '3.11'
|
161
161
|
type: :development
|
162
162
|
prerelease: false
|
163
163
|
version_requirements: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
|
-
- - ~>
|
165
|
+
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '3.11'
|
168
168
|
description: |-
|
@@ -177,7 +177,7 @@ description: |-
|
|
177
177
|
|
178
178
|
ActiveRecord extensions for sanitization are available in the
|
179
179
|
`loofah-activerecord` gem (see
|
180
|
-
|
180
|
+
https://github.com/flavorjones/loofah-activerecord).
|
181
181
|
email:
|
182
182
|
- mike.dalessio@gmail.com
|
183
183
|
- bryan@brynary.com
|
@@ -189,6 +189,7 @@ extra_rdoc_files:
|
|
189
189
|
- Manifest.txt
|
190
190
|
- README.rdoc
|
191
191
|
files:
|
192
|
+
- ".gemtest"
|
192
193
|
- CHANGELOG.rdoc
|
193
194
|
- Gemfile
|
194
195
|
- MIT-LICENSE.txt
|
@@ -225,30 +226,29 @@ files:
|
|
225
226
|
- test/unit/test_helpers.rb
|
226
227
|
- test/unit/test_scrubber.rb
|
227
228
|
- test/unit/test_scrubbers.rb
|
228
|
-
|
229
|
-
homepage: http://github.com/flavorjones/loofah
|
229
|
+
homepage: https://github.com/flavorjones/loofah
|
230
230
|
licenses:
|
231
231
|
- MIT
|
232
232
|
metadata: {}
|
233
233
|
post_install_message:
|
234
234
|
rdoc_options:
|
235
|
-
- --main
|
235
|
+
- "--main"
|
236
236
|
- README.rdoc
|
237
237
|
require_paths:
|
238
238
|
- lib
|
239
239
|
required_ruby_version: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- -
|
241
|
+
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- -
|
246
|
+
- - ">="
|
247
247
|
- !ruby/object:Gem::Version
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project:
|
251
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.2.2
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: Loofah is a general library for manipulating and transforming HTML/XML documents
|