loofah 1.0.0 → 2.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +489 -0
- data/MIT-LICENSE.txt +3 -1
- data/README.md +364 -0
- data/SECURITY.md +18 -0
- data/lib/loofah/elements.rb +88 -11
- data/lib/loofah/helpers.rb +76 -2
- data/lib/loofah/html/document.rb +1 -0
- data/lib/loofah/html/document_fragment.rb +9 -2
- data/lib/loofah/html5/libxml2_workarounds.rb +27 -0
- data/lib/loofah/html5/safelist.rb +1042 -0
- data/lib/loofah/html5/scrub.rb +198 -40
- data/lib/loofah/instance_methods.rb +16 -10
- data/lib/loofah/metahelpers.rb +9 -10
- data/lib/loofah/scrubber.rb +22 -6
- data/lib/loofah/scrubbers.rb +96 -16
- data/lib/loofah/version.rb +5 -0
- data/lib/loofah/xml/document.rb +1 -0
- data/lib/loofah/xml/document_fragment.rb +5 -2
- data/lib/loofah.rb +38 -25
- metadata +159 -172
- data/CHANGELOG.rdoc +0 -134
- data/Gemfile +0 -1
- data/Manifest.txt +0 -34
- data/README.rdoc +0 -312
- data/Rakefile +0 -53
- data/benchmark/benchmark.rb +0 -149
- data/benchmark/fragment.html +0 -96
- data/benchmark/helper.rb +0 -73
- data/benchmark/www.slashdot.com.html +0 -2560
- data/lib/loofah/html5/whitelist.rb +0 -168
- data/test/helper.rb +0 -7
- data/test/html5/test_sanitizer.rb +0 -248
- data/test/integration/test_ad_hoc.rb +0 -176
- data/test/integration/test_helpers.rb +0 -33
- data/test/integration/test_html.rb +0 -51
- data/test/integration/test_scrubbers.rb +0 -331
- data/test/integration/test_xml.rb +0 -55
- data/test/unit/test_api.rb +0 -138
- data/test/unit/test_helpers.rb +0 -27
- data/test/unit/test_scrubber.rb +0 -229
- data/test/unit/test_scrubbers.rb +0 -14
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bd3edb0acdf2359d82564aca0bc13710d9f6c49157963d18953ff55bd7c14413
|
4
|
+
data.tar.gz: 3a6e11b7deb9cfb469aaf6ec919062687bd4215ef11980bded72ca298807610c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4970a6aa72265f60556dd6fd254375c86d3f83be23f3bbcc8b04df00ce0e801e8ef9e67d0a77ca6a21915be89226131c16a7f3540f02538cc2b9a369950dfebf
|
7
|
+
data.tar.gz: 27e3a06cc391ec3d9e3c966efdb6b4ce58e98c397ec87490d418406c17757e5cb0193edabaced30a9f24320c729e6730308e346610859f9f7c6d5fcc6f72cd56
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,489 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 2.19.1 / 2022-12-13
|
4
|
+
|
5
|
+
### Security
|
6
|
+
|
7
|
+
* Address CVE-2022-23514, inefficient regular expression complexity. See [GHSA-486f-hjj9-9vhh](https://github.com/flavorjones/loofah/security/advisories/GHSA-486f-hjj9-9vhh) for more information.
|
8
|
+
* Address CVE-2022-23515, improper neutralization of data URIs. See [GHSA-228g-948r-83gx](https://github.com/flavorjones/loofah/security/advisories/GHSA-228g-948r-83gx) for more information.
|
9
|
+
* Address CVE-2022-23516, uncontrolled recursion. See [GHSA-3x8r-x6xp-q4vm](https://github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vm) for more information.
|
10
|
+
|
11
|
+
|
12
|
+
## 2.19.0 / 2022-09-14
|
13
|
+
|
14
|
+
### Features
|
15
|
+
|
16
|
+
* Allow SVG 1.0 color keyword names in CSS attributes. These colors are part of the [CSS Color Module Level 3](https://www.w3.org/TR/css-color-3/#svg-color) recommendation released 2022-01-18. [[#243](https://github.com/flavorjones/loofah/issues/243)]
|
17
|
+
|
18
|
+
|
19
|
+
## 2.18.0 / 2022-05-11
|
20
|
+
|
21
|
+
### Features
|
22
|
+
|
23
|
+
* Allow CSS property `aspect-ratio`. [[#236](https://github.com/flavorjones/loofah/issues/236)] (Thanks, [@louim](https://github.com/louim)!)
|
24
|
+
|
25
|
+
|
26
|
+
## 2.17.0 / 2022-04-28
|
27
|
+
|
28
|
+
### Features
|
29
|
+
|
30
|
+
* Allow ARIA attributes. [[#232](https://github.com/flavorjones/loofah/issues/232), [#233](https://github.com/flavorjones/loofah/issues/233)] (Thanks, [@nick-desteffen](https://github.com/nick-desteffen)!)
|
31
|
+
|
32
|
+
|
33
|
+
## 2.16.0 / 2022-04-01
|
34
|
+
|
35
|
+
### Features
|
36
|
+
|
37
|
+
* Allow MathML elements `menclose` and `ms`, and MathML attributes `dir`, `href`, `lquote`, `mathsize`, `notation`, and `rquote`. [[#231](https://github.com/flavorjones/loofah/issues/231)] (Thanks, [@nick-desteffen](https://github.com/nick-desteffen)!)
|
38
|
+
|
39
|
+
|
40
|
+
## 2.15.0 / 2022-03-14
|
41
|
+
|
42
|
+
### Features
|
43
|
+
|
44
|
+
* Expand set of allowed protocols to include `sms:`. [[#228](https://github.com/flavorjones/loofah/issues/228)] (Thanks, [@brendon](https://github.com/brendon)!)
|
45
|
+
|
46
|
+
|
47
|
+
## 2.14.0 / 2022-02-11
|
48
|
+
|
49
|
+
### Features
|
50
|
+
|
51
|
+
* The `#to_text` method on `Loofah::HTML::{Document,DocumentFragment}` replaces `<br>` line break elements with a newline. [[#225](https://github.com/flavorjones/loofah/issues/225)]
|
52
|
+
|
53
|
+
|
54
|
+
## 2.13.0 / 2021-12-10
|
55
|
+
|
56
|
+
### Bug fixes
|
57
|
+
|
58
|
+
* Loofah::HTML::DocumentFragment#text no longer serializes top-level comment children. [[#221](https://github.com/flavorjones/loofah/issues/221)]
|
59
|
+
|
60
|
+
|
61
|
+
## 2.12.0 / 2021-08-11
|
62
|
+
|
63
|
+
### Features
|
64
|
+
|
65
|
+
* Support empty HTML5 data attributes. [[#215](https://github.com/flavorjones/loofah/issues/215)]
|
66
|
+
|
67
|
+
|
68
|
+
## 2.11.0 / 2021-07-31
|
69
|
+
|
70
|
+
### Features
|
71
|
+
|
72
|
+
* Allow HTML5 element `wbr`.
|
73
|
+
* Allow all CSS property values for `border-collapse`. [[#201](https://github.com/flavorjones/loofah/issues/201)]
|
74
|
+
|
75
|
+
|
76
|
+
### Changes
|
77
|
+
|
78
|
+
* Deprecating `Loofah::HTML5::SafeList::VOID_ELEMENTS` which is not a canonical list of void HTML4 or HTML5 elements.
|
79
|
+
* Removed some elements from `Loofah::HTML5::SafeList::VOID_ELEMENTS` that either are not acceptable elements or aren't considered "void" by libxml2.
|
80
|
+
|
81
|
+
|
82
|
+
## 2.10.0 / 2021-06-06
|
83
|
+
|
84
|
+
### Features
|
85
|
+
|
86
|
+
* Allow CSS properties `overflow-x` and `overflow-y`. [[#206](https://github.com/flavorjones/loofah/issues/206)] (Thanks, [@sampokuokkanen](https://github.com/sampokuokkanen)!)
|
87
|
+
|
88
|
+
|
89
|
+
## 2.9.1 / 2021-04-07
|
90
|
+
|
91
|
+
### Bug fixes
|
92
|
+
|
93
|
+
* Fix a regression in v2.9.0 which inappropriately removed CSS properties with quoted string values. [[#202](https://github.com/flavorjones/loofah/issues/202)]
|
94
|
+
|
95
|
+
|
96
|
+
## 2.9.0 / 2021-01-14
|
97
|
+
|
98
|
+
### Features
|
99
|
+
|
100
|
+
* Handle CSS functions in a CSS shorthand property (like `background`). [[#199](https://github.com/flavorjones/loofah/issues/199), [#200](https://github.com/flavorjones/loofah/issues/200)]
|
101
|
+
|
102
|
+
|
103
|
+
## 2.8.0 / 2020-11-25
|
104
|
+
|
105
|
+
### Features
|
106
|
+
|
107
|
+
* Allow CSS properties `order`, `flex-direction`, `flex-grow`, `flex-wrap`, `flex-shrink`, `flex-flow`, `flex-basis`, `flex`, `justify-content`, `align-self`, `align-items`, and `align-content`. [[#197](https://github.com/flavorjones/loofah/issues/197)] (Thanks, [@miguelperez](https://github.com/miguelperez)!)
|
108
|
+
|
109
|
+
|
110
|
+
## 2.7.0 / 2020-08-26
|
111
|
+
|
112
|
+
### Features
|
113
|
+
|
114
|
+
* Allow CSS properties `page-break-before`, `page-break-inside`, and `page-break-after`. [[#190](https://github.com/flavorjones/loofah/issues/190)] (Thanks, [@ahorek](https://github.com/ahorek)!)
|
115
|
+
|
116
|
+
|
117
|
+
### Fixes
|
118
|
+
|
119
|
+
* Don't drop the `!important` rule from some CSS properties. [[#191](https://github.com/flavorjones/loofah/issues/191)] (Thanks, [@b7kich](https://github.com/b7kich)!)
|
120
|
+
|
121
|
+
|
122
|
+
## 2.6.0 / 2020-06-16
|
123
|
+
|
124
|
+
### Features
|
125
|
+
|
126
|
+
* Allow CSS `border-style` keywords. [[#188](https://github.com/flavorjones/loofah/issues/188)] (Thanks, [@tarcisiozf](https://github.com/tarcisiozf)!)
|
127
|
+
|
128
|
+
|
129
|
+
## 2.5.0 / 2020-04-05
|
130
|
+
|
131
|
+
### Features
|
132
|
+
|
133
|
+
* Allow more CSS length units: "ch", "vw", "vh", "Q", "lh", "vmin", "vmax". [[#178](https://github.com/flavorjones/loofah/issues/178)] (Thanks, [@JuanitoFatas](https://github.com/JuanitoFatas)!)
|
134
|
+
|
135
|
+
|
136
|
+
### Fixes
|
137
|
+
|
138
|
+
* Remove comments from `Loofah::HTML::Document`s that exist outside the `html` element. [[#80](https://github.com/flavorjones/loofah/issues/80)]
|
139
|
+
|
140
|
+
|
141
|
+
### Other changes
|
142
|
+
|
143
|
+
* Gem metadata being set [[#181](https://github.com/flavorjones/loofah/issues/181)] (Thanks, [@JuanitoFatas](https://github.com/JuanitoFatas)!)
|
144
|
+
* Test files removed from gem file [[#180](https://github.com/flavorjones/loofah/issues/180),[#166](https://github.com/flavorjones/loofah/issues/166),[#159](https://github.com/flavorjones/loofah/issues/159)] (Thanks, [@JuanitoFatas](https://github.com/JuanitoFatas) and [@greysteil](https://github.com/greysteil)!)
|
145
|
+
|
146
|
+
|
147
|
+
## 2.4.0 / 2019-11-25
|
148
|
+
|
149
|
+
### Features
|
150
|
+
|
151
|
+
* Allow CSS property `max-width` [[#175](https://github.com/flavorjones/loofah/issues/175)] (Thanks, [@bchaney](https://github.com/bchaney)!)
|
152
|
+
* Allow CSS sizes expressed in `rem` [[#176](https://github.com/flavorjones/loofah/issues/176), [#177](https://github.com/flavorjones/loofah/issues/177)]
|
153
|
+
* Add `frozen_string_literal: true` magic comment to all `lib` files. [[#118](https://github.com/flavorjones/loofah/issues/118)]
|
154
|
+
|
155
|
+
|
156
|
+
## 2.3.1 / 2019-10-22
|
157
|
+
|
158
|
+
### Security
|
159
|
+
|
160
|
+
Address CVE-2019-15587: Unsanitized JavaScript may occur in sanitized output when a crafted SVG element is republished.
|
161
|
+
|
162
|
+
This CVE's public notice is at [#171](https://github.com/flavorjones/loofah/issues/171)
|
163
|
+
|
164
|
+
|
165
|
+
## 2.3.0 / 2019-09-28
|
166
|
+
|
167
|
+
### Features
|
168
|
+
|
169
|
+
* Expand set of allowed protocols to include `tel:` and `line:`. [[#104](https://github.com/flavorjones/loofah/issues/104), [#147](https://github.com/flavorjones/loofah/issues/147)]
|
170
|
+
* Expand set of allowed CSS functions. [related to [#122](https://github.com/flavorjones/loofah/issues/122)]
|
171
|
+
* Allow greater precision in shorthand CSS values. [[#149](https://github.com/flavorjones/loofah/issues/149)] (Thanks, [@danfstucky](https://github.com/danfstucky)!)
|
172
|
+
* Allow CSS property `list-style` [[#162](https://github.com/flavorjones/loofah/issues/162)] (Thanks, [@jaredbeck](https://github.com/jaredbeck)!)
|
173
|
+
* Allow CSS keywords `thick` and `thin` [[#168](https://github.com/flavorjones/loofah/issues/168)] (Thanks, [@georgeclaghorn](https://github.com/georgeclaghorn)!)
|
174
|
+
* Allow HTML property `contenteditable` [[#167](https://github.com/flavorjones/loofah/issues/167)] (Thanks, [@andreynering](https://github.com/andreynering)!)
|
175
|
+
|
176
|
+
|
177
|
+
### Bug fixes
|
178
|
+
|
179
|
+
* CSS hex values are no longer limited to lowercase hex. Previously uppercase hex were scrubbed. [[#165](https://github.com/flavorjones/loofah/issues/165)] (Thanks, [@asok](https://github.com/asok)!)
|
180
|
+
|
181
|
+
|
182
|
+
### Deprecations / Name Changes
|
183
|
+
|
184
|
+
The following method and constants are hereby deprecated, and will be completely removed in a future release:
|
185
|
+
|
186
|
+
* Deprecate `Loofah::Helpers::ActionView.white_list_sanitizer`, please use `Loofah::Helpers::ActionView.safe_list_sanitizer` instead.
|
187
|
+
* Deprecate `Loofah::Helpers::ActionView::WhiteListSanitizer`, please use `Loofah::Helpers::ActionView::SafeListSanitizer` instead.
|
188
|
+
* Deprecate `Loofah::HTML5::WhiteList`, please use `Loofah::HTML5::SafeList` instead.
|
189
|
+
|
190
|
+
Thanks to [@JuanitoFatas](https://github.com/JuanitoFatas) for submitting these changes in [#164](https://github.com/flavorjones/loofah/issues/164) and for making the language used in Loofah more inclusive.
|
191
|
+
|
192
|
+
|
193
|
+
## 2.2.3 / 2018-10-30
|
194
|
+
|
195
|
+
### Security
|
196
|
+
|
197
|
+
Address CVE-2018-16468: Unsanitized JavaScript may occur in sanitized output when a crafted SVG element is republished.
|
198
|
+
|
199
|
+
This CVE's public notice is at [#154](https://github.com/flavorjones/loofah/issues/154)
|
200
|
+
|
201
|
+
|
202
|
+
## Meta / 2018-10-27
|
203
|
+
|
204
|
+
The mailing list is now on Google Groups [#146](https://github.com/flavorjones/loofah/issues/146):
|
205
|
+
|
206
|
+
* Mail: loofah-talk@googlegroups.com
|
207
|
+
* Archive: https://groups.google.com/forum/#!forum/loofah-talk
|
208
|
+
|
209
|
+
This change was made because librelist no longer appears to be maintained.
|
210
|
+
|
211
|
+
|
212
|
+
## 2.2.2 / 2018-03-22
|
213
|
+
|
214
|
+
Make public `Loofah::HTML5::Scrub.force_correct_attribute_escaping!`,
|
215
|
+
which was previously a private method. This is so that downstream gems
|
216
|
+
(like rails-html-sanitizer) can use this logic directly for their own
|
217
|
+
attribute scrubbers should they need to address CVE-2018-8048.
|
218
|
+
|
219
|
+
|
220
|
+
## 2.2.1 / 2018-03-19
|
221
|
+
|
222
|
+
### Security
|
223
|
+
|
224
|
+
Addresses CVE-2018-8048. Loofah allowed non-whitelisted attributes to be present in sanitized output when input with specially-crafted HTML fragments.
|
225
|
+
|
226
|
+
This CVE's public notice is at [#144](https://github.com/flavorjones/loofah/issues/144)
|
227
|
+
|
228
|
+
|
229
|
+
## 2.2.0 / 2018-02-11
|
230
|
+
|
231
|
+
### Features:
|
232
|
+
|
233
|
+
* Support HTML5 `<main>` tag. [#133](https://github.com/flavorjones/loofah/issues/133) (Thanks, [@MothOnMars](https://github.com/MothOnMars)!)
|
234
|
+
* Recognize HTML5 block elements. [#136](https://github.com/flavorjones/loofah/issues/136) (Thanks, [@MothOnMars](https://github.com/MothOnMars)!)
|
235
|
+
* Support SVG `<symbol>` tag. [#131](https://github.com/flavorjones/loofah/issues/131) (Thanks, [@baopham](https://github.com/baopham)!)
|
236
|
+
* Support for whitelisting CSS functions, initially just `calc` and `rgb`. [#122](https://github.com/flavorjones/loofah/issues/122)/[#123](https://github.com/flavorjones/loofah/issues/123)/[#129](https://github.com/flavorjones/loofah/issues/129) (Thanks, [@NikoRoberts](https://github.com/NikoRoberts)!)
|
237
|
+
* Whitelist CSS property `list-style-type`. [#68](https://github.com/flavorjones/loofah/issues/68)/[#137](https://github.com/flavorjones/loofah/issues/137)/[#142](https://github.com/flavorjones/loofah/issues/142) (Thanks, [@andela-ysanni](https://github.com/andela-ysanni) and [@NikoRoberts](https://github.com/NikoRoberts)!)
|
238
|
+
|
239
|
+
### Bugfixes:
|
240
|
+
|
241
|
+
* Properly handle nested `script` tags. [#127](https://github.com/flavorjones/loofah/issues/127).
|
242
|
+
|
243
|
+
|
244
|
+
## 2.1.1 / 2017-09-24
|
245
|
+
|
246
|
+
### Bugfixes:
|
247
|
+
|
248
|
+
* Removed warning for unused variable. [#124](https://github.com/flavorjones/loofah/issues/124) (Thanks, [@y-yagi](https://github.com/y-yagi)!)
|
249
|
+
|
250
|
+
|
251
|
+
## 2.1.0 / 2017-09-24
|
252
|
+
|
253
|
+
### Notes:
|
254
|
+
|
255
|
+
* Re-implemented CSS parsing and sanitization using the [crass](https://github.com/rgrove/crass) library. [#91](https://github.com/flavorjones/loofah/issues/91)
|
256
|
+
|
257
|
+
|
258
|
+
### Features:
|
259
|
+
|
260
|
+
* Added :noopener HTML scrubber (Thanks, [@tastycode](https://github.com/tastycode)!)
|
261
|
+
* Support `data` URIs with the following media types: text/plain, text/css, image/png, image/gif, image/jpeg, image/svg+xml. [#101](https://github.com/flavorjones/loofah/issues/101), [#120](https://github.com/flavorjones/loofah/issues/120). (Thanks, [@mrpasquini](https://github.com/mrpasquini)!)
|
262
|
+
|
263
|
+
|
264
|
+
### Bugfixes:
|
265
|
+
|
266
|
+
* The :unprintable scrubber now scrubs unprintable characters in CDATA nodes (like `<script>`). [#124](https://github.com/flavorjones/loofah/issues/124)
|
267
|
+
* Allow negative values in CSS properties. Restores functionality that was reverted in v2.0.3. [#91](https://github.com/flavorjones/loofah/issues/91)
|
268
|
+
|
269
|
+
|
270
|
+
## 2.0.3 / 2015-08-17
|
271
|
+
|
272
|
+
### Bug fixes:
|
273
|
+
|
274
|
+
* Revert support for negative values in CSS properties due to slow performance. [#90](https://github.com/flavorjones/loofah/issues/90) (Related to [#85](https://github.com/flavorjones/loofah/issues/85).)
|
275
|
+
|
276
|
+
|
277
|
+
## 2.0.2 / 2015-05-05
|
278
|
+
|
279
|
+
### Bug fixes:
|
280
|
+
|
281
|
+
* Fix error with `#to_text` when Loofah::Helpers hadn't been required. [#75](https://github.com/flavorjones/loofah/issues/75)
|
282
|
+
* Allow multi-word data attributes. [#84](https://github.com/flavorjones/loofah/issues/84) (Thanks, [@jstorimer](https://github.com/jstorimer)!)
|
283
|
+
* Allow negative values in CSS properties. [#85](https://github.com/flavorjones/loofah/issues/85) (Thanks, [@siddhartham](https://github.com/siddhartham)!)
|
284
|
+
|
285
|
+
|
286
|
+
## 2.0.1 / 2014-08-21
|
287
|
+
|
288
|
+
### Bug fixes:
|
289
|
+
|
290
|
+
* Load RR correctly when running test files directly. (Thanks, [@ktdreyer](https://github.com/ktdreyer)!)
|
291
|
+
|
292
|
+
|
293
|
+
### Notes:
|
294
|
+
|
295
|
+
* Extracted HTML5::Scrub#scrub_css_attribute to accommodate the Rails integration work. (Thanks, [@kaspth](https://github.com/kaspth)!)
|
296
|
+
|
297
|
+
|
298
|
+
## 2.0.0 / 2014-05-09
|
299
|
+
|
300
|
+
### Compatibility notes:
|
301
|
+
|
302
|
+
* ActionView helpers now must be required explicitly: `require "loofah/helpers"`
|
303
|
+
* Support for Ruby 1.8.7 and prior has been dropped
|
304
|
+
|
305
|
+
### Enhancements:
|
306
|
+
|
307
|
+
* HTML5 whitelist allows the following ...
|
308
|
+
* tags: `article`, `aside`, `bdi`, `bdo`, `canvas`, `command`, `datalist`, `details`, `figcaption`, `figure`, `footer`, `header`, `mark`, `meter`, `nav`, `output`, `section`, `summary`, `time`
|
309
|
+
* attributes: `data-*` (Thanks, Rafael Franca!)
|
310
|
+
* URI attributes: `poster` and `preload`
|
311
|
+
* Addition of the `:unprintable` scrubber to remove unprintable characters from text nodes. [#65](https://github.com/flavorjones/loofah/issues/65) (Thanks, Matt Swanson!)
|
312
|
+
* `Loofah.fragment` accepts an optional encoding argument, compatible with `Nokogiri::HTML::DocumentFragment.parse`. [#62](https://github.com/flavorjones/loofah/issues/62) (Thanks, Ben Atkins!)
|
313
|
+
* HTML5 sanitizers now remove attributes without values. (Thanks, Kasper Timm Hansen!)
|
314
|
+
|
315
|
+
### Bug fixes:
|
316
|
+
|
317
|
+
* HTML5 sanitizers' CSS keyword check now actually works (broken in v2.0). Additional regression tests added. (Thanks, Kasper Timm Hansen!)
|
318
|
+
* HTML5 sanitizers now allow negative arguments to CSS. [#64](https://github.com/flavorjones/loofah/issues/64) (Thanks, Jon Calhoun!)
|
319
|
+
|
320
|
+
|
321
|
+
## 1.2.1 (2012-04-14)
|
322
|
+
|
323
|
+
* Declaring encoding in html5/scrub.rb. Without this, use of the ruby -KU option would cause havoc. ([#32](https://github.com/flavorjones/loofah/issues/32))
|
324
|
+
|
325
|
+
|
326
|
+
## 1.2.0 (2011-08-08)
|
327
|
+
|
328
|
+
### Enhancements:
|
329
|
+
|
330
|
+
* Loofah::Helpers.sanitize_css is a replacement for Rails's built-in sanitize_css helper.
|
331
|
+
* Improving ActionView integration.
|
332
|
+
|
333
|
+
|
334
|
+
## 1.1.0 (2011-08-08)
|
335
|
+
|
336
|
+
### Enhancements:
|
337
|
+
|
338
|
+
* Additional HTML5lib whitelist elements (from html5lib 1524:80b5efe26230).
|
339
|
+
Up to date with HTML5lib ruby code as of 1723:7ee6a0331856.
|
340
|
+
* Whitelists (which are not part of the public API) are now Sets (were previously Arrays).
|
341
|
+
* Don't explode when encountering UTF-8 URIs. ([#25](https://github.com/flavorjones/loofah/issues/25), [#29](https://github.com/flavorjones/loofah/issues/29))
|
342
|
+
|
343
|
+
|
344
|
+
## 1.0.0 (2010-10-26)
|
345
|
+
|
346
|
+
### Notes:
|
347
|
+
|
348
|
+
* Moved ActiveRecord functionality into `loofah-activerecord` gem.
|
349
|
+
* Removed DEPRECATIONS.rdoc documenting 0.3.0 API changes.
|
350
|
+
|
351
|
+
|
352
|
+
## 0.4.7 (2010-03-09)
|
353
|
+
|
354
|
+
### Enhancements:
|
355
|
+
|
356
|
+
* New methods Loofah::HTML::Document#to_text and
|
357
|
+
Loofah::HTML::DocumentFragment#to_text do the right thing with
|
358
|
+
whitespace. Note that these methods are significantly slower than
|
359
|
+
#text. GH [#12](https://github.com/flavorjones/loofah/issues/12)
|
360
|
+
* Loofah::Elements::BLOCK_LEVEL contains a canonical list of HTML4 block-level4 elements.
|
361
|
+
* Loofah::HTML::Document#text and Loofah::HTML::DocumentFragment#text
|
362
|
+
will return unescaped HTML entities by passing :encode_special_chars => false.
|
363
|
+
|
364
|
+
|
365
|
+
## 0.4.4, 0.4.5, 0.4.6 (2010-02-01)
|
366
|
+
|
367
|
+
### Enhancements:
|
368
|
+
|
369
|
+
* Loofah::HTML::Document#text and Loofah::HTML::DocumentFragment#text now escape HTML entities.
|
370
|
+
|
371
|
+
### Bug fixes:
|
372
|
+
|
373
|
+
* Loofah::XssFoliate was not properly escaping HTML entities when implicitly scrubbing a string attribute. GH [#17](https://github.com/flavorjones/loofah/issues/17)
|
374
|
+
|
375
|
+
|
376
|
+
## 0.4.3 (2010-01-29)
|
377
|
+
|
378
|
+
### Enhancements:
|
379
|
+
|
380
|
+
* All built-in scrubbers are accepted by ActiveRecord::Base.xss_foliate
|
381
|
+
* Loofah::XssFoliate.xss_foliate_all_models replaces use of the constant LOOFAH_XSS_FOLIATE_ALL_MODELS
|
382
|
+
|
383
|
+
### Miscellaneous:
|
384
|
+
|
385
|
+
* Modified documentation for bootstrapping XssFoliate in a Rails app,
|
386
|
+
since the use of Bundler breaks the previously-documented method. To
|
387
|
+
be safe, always use an initializer file.
|
388
|
+
|
389
|
+
|
390
|
+
## 0.4.2 (2010-01-22)
|
391
|
+
|
392
|
+
### Enhancements:
|
393
|
+
|
394
|
+
* Implemented Node#scrub! for scrubbing subtrees.
|
395
|
+
* Implemented NodeSet#scrub! for scrubbing a set of subtrees.
|
396
|
+
* Document.text now only serializes <body> contents (ignores <head>)
|
397
|
+
* <head>, <html> and <body> added to the HTML5lib whitelist.
|
398
|
+
|
399
|
+
### Bug fixes:
|
400
|
+
|
401
|
+
* Supporting Rails apps that aren't loading ActiveRecord. GH [#10](https://github.com/flavorjones/loofah/issues/10)
|
402
|
+
|
403
|
+
### Miscellaneous:
|
404
|
+
|
405
|
+
* Mailing list is now loofah@librelist.com / http://librelist.com
|
406
|
+
* IRC channel is now \#loofah on freenode.
|
407
|
+
|
408
|
+
|
409
|
+
## 0.4.1 (2009-11-23)
|
410
|
+
|
411
|
+
### Bugfix:
|
412
|
+
|
413
|
+
* Manifest fixed. Whoops.
|
414
|
+
|
415
|
+
|
416
|
+
## 0.4.0 (2009-11-21)
|
417
|
+
|
418
|
+
### Enhancements:
|
419
|
+
|
420
|
+
* Scrubber class introduced, allowing development of custom scrubbers.
|
421
|
+
* Added support for XML documents and fragments.
|
422
|
+
* Added :nofollow HTML scrubber (thanks Luke Melia!)
|
423
|
+
* Built-in scrubbing methods refactored to use Scrubber.
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
## 0.3.1 (2009-10-12)
|
428
|
+
|
429
|
+
### Bug fixes:
|
430
|
+
|
431
|
+
* Scrubbed Documents properly render html, head and body tags when serialized.
|
432
|
+
|
433
|
+
|
434
|
+
## 0.3.0 (2009-10-06)
|
435
|
+
|
436
|
+
### Enhancements:
|
437
|
+
|
438
|
+
* New ActiveRecord extension `xss_foliate`, a drop-in replacement for xss_terminate[http://github.com/look/xss_terminate/tree/master].
|
439
|
+
* Replacement methods for Rails's helpers, Loofah::Rails.sanitize and Loofah::Rails.strip_tags.
|
440
|
+
* Official support (and test coverage) for Rails versions 2.3, 2.2, 2.1, 2.0 and 1.2.
|
441
|
+
|
442
|
+
### Deprecations:
|
443
|
+
|
444
|
+
* The methods strip_tags, whitewash, whitewash_document, sanitize, and
|
445
|
+
sanitize_document have been deprecated. See DEPRECATED.rdoc for
|
446
|
+
details on the equivalent calls with the post-0.2 API.
|
447
|
+
|
448
|
+
|
449
|
+
## 0.2.2 (2009-09-30)
|
450
|
+
|
451
|
+
### Enhancements:
|
452
|
+
|
453
|
+
* ActiveRecord extension scrubs fields in a before_validation callback
|
454
|
+
(was previously in a before_save)
|
455
|
+
|
456
|
+
|
457
|
+
## 0.2.1 (2009-09-19)
|
458
|
+
|
459
|
+
### Enhancements:
|
460
|
+
|
461
|
+
* when loaded in a Rails app, automatically extend ActiveRecord::Base
|
462
|
+
with html_fragment and html_document. GH [#6](https://github.com/flavorjones/loofah/issues/6) (Thanks Josh Nichols!)
|
463
|
+
|
464
|
+
### Bugfixes:
|
465
|
+
|
466
|
+
* ActiveRecord scrubbing should generate strings instead of Document or
|
467
|
+
DocumentFragment objects. GH [#5](https://github.com/flavorjones/loofah/issues/5)
|
468
|
+
* init.rb fixed to support installation as a Rails plugin. GH [#6](https://github.com/flavorjones/loofah/issues/6)
|
469
|
+
(Thanks Josh Nichols!)
|
470
|
+
|
471
|
+
|
472
|
+
## 0.2.0 (2009-09-11)
|
473
|
+
|
474
|
+
* Swank new API.
|
475
|
+
* ActiveRecord extension.
|
476
|
+
* Uses Nokogiri's Document and DocumentFragment for parsing.
|
477
|
+
* Updated html5lib codes and tests to revision 1384:b9d3153d7be7.
|
478
|
+
* Deprecated the Dryopteris sanitization methods. Will be removed in 0.3.0.
|
479
|
+
* Documentation! Hey!
|
480
|
+
|
481
|
+
|
482
|
+
## 0.1.2 (2009-04-30)
|
483
|
+
|
484
|
+
* Added whitewashing -- removal of all attributes and namespaced nodes. You know, for microsofty HTML.
|
485
|
+
|
486
|
+
|
487
|
+
## 0.1.0 (2009-02-10)
|
488
|
+
|
489
|
+
* Birthday!
|
data/MIT-LICENSE.txt
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
|
3
|
+
The MIT License
|
4
|
+
|
5
|
+
Copyright (c) 2009 -- 2018 by Mike Dalessio, Bryan Helmkamp
|
4
6
|
|
5
7
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
8
|
of this software and associated documentation files (the "Software"), to deal
|