sanitize 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sanitize might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/HISTORY.md +11 -0
- data/lib/sanitize/transformers/clean_element.rb +7 -2
- data/lib/sanitize/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4449bae9ce55a4f01d76a2984b68a6ea79b0d71b
|
4
|
+
data.tar.gz: 85752ade687b9c6d54d9a4c13dac42dcee670853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 989d449b758fa4c69c5484e50fcc7f72b41888fe86708e2e459789c1187a8d15e7d70dcce6f335e98ef8b9b927d198b6452a4e3955eb728eaee10b9df3169beb
|
7
|
+
data.tar.gz: c8f1100f741d8211c990e34fc2bbdd1e42b013f704c2b56da30e0af984d220e03af9e88a4cfe0fac4025ed467bc6a1406d5da6bdef8280f1ec78f0dc315ef074
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
Sanitize History
|
2
2
|
================================================================================
|
3
3
|
|
4
|
+
Version 3.1.2 (2015-02-22)
|
5
|
+
--------------------------
|
6
|
+
|
7
|
+
* Fixed: Deleting a node in a custom transformer could trigger a memory leak
|
8
|
+
in Nokogiri if that node's children were later reparented, which the built-in
|
9
|
+
CleanElement transformer did by default. The CleanElement transformer is now
|
10
|
+
careful not to reparent the children of deleted nodes. [#129][129]
|
11
|
+
|
12
|
+
[129]:https://github.com/rgrove/sanitize/issues/129
|
13
|
+
|
14
|
+
|
4
15
|
Version 3.1.1 (2015-02-04)
|
5
16
|
--------------------------
|
6
17
|
|
@@ -55,8 +55,13 @@ class Sanitize; module Transformers; class CleanElement
|
|
55
55
|
|
56
56
|
name = env[:node_name]
|
57
57
|
|
58
|
-
# Delete any element that isn't in the config whitelist
|
59
|
-
|
58
|
+
# Delete any element that isn't in the config whitelist, unless the node has
|
59
|
+
# already been deleted from the document.
|
60
|
+
#
|
61
|
+
# It's important that we not try to reparent the children of a node that has
|
62
|
+
# already been deleted, since that seems to trigger a memory leak in
|
63
|
+
# Nokogiri.
|
64
|
+
unless @elements.include?(name) || node.parent.nil?
|
60
65
|
# Elements like br, div, p, etc. need to be replaced with whitespace in
|
61
66
|
# order to preserve readability.
|
62
67
|
if @whitespace_elements.include?(name)
|
data/lib/sanitize/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanitize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Grove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crass
|