sanitize 3.0.3 → 3.0.4
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 +10 -0
- data/lib/sanitize.rb +1 -1
- data/lib/sanitize/version.rb +1 -1
- data/test/test_clean_element.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba375648ad289cc08ce45eafc47ed464ce6e7f9e
|
4
|
+
data.tar.gz: 88022411ca58369ad7f0699f022c67c344891e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24abf590a86b592353ca6b5602afef29c30b1063a5bb1c907bd9a51d6ee6962a2a733abd7b4ef8923aee0221eb2c3935221615c9f257363a1cc0cae906e34026
|
7
|
+
data.tar.gz: 4b18f5dd27ccb560f96189eb081ab100d33604c87e08f7d24ce183b5cc5c5b58f6848a30d3aad51e9cffd3228c9baa6f4090ea185d6aaee0f2f55fb253069f42
|
data/HISTORY.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
Sanitize History
|
2
2
|
================================================================================
|
3
3
|
|
4
|
+
Version 3.0.4 (2014-12-12)
|
5
|
+
--------------------------
|
6
|
+
|
7
|
+
* Fixed: Harmless whitespace preceding a URL protocol (such as " http://")
|
8
|
+
caused the URL to be removed even when the protocol was whitelisted.
|
9
|
+
[@benubois - #126][126]
|
10
|
+
|
11
|
+
[126]:https://github.com/rgrove/sanitize/pull/126
|
12
|
+
|
13
|
+
|
4
14
|
Version 3.0.3 (2014-10-29)
|
5
15
|
--------------------------
|
6
16
|
|
data/lib/sanitize.rb
CHANGED
@@ -24,7 +24,7 @@ class Sanitize
|
|
24
24
|
# or more characters followed by a colon is considered a match, even if the
|
25
25
|
# colon is encoded as an entity and even if it's an incomplete entity (which
|
26
26
|
# IE6 and Opera will still parse).
|
27
|
-
REGEX_PROTOCOL = /\A([^\/#]*?)(?:\:|�*58|�*3a)/i
|
27
|
+
REGEX_PROTOCOL = /\A\s*([^\/#]*?)(?:\:|�*58|�*3a)/i
|
28
28
|
|
29
29
|
# Matches Unicode characters that should be stripped from HTML before passing
|
30
30
|
# it to the parser.
|
data/lib/sanitize/version.rb
CHANGED
data/test/test_clean_element.rb
CHANGED
@@ -154,6 +154,14 @@ describe 'Sanitize::Transformers::CleanElement' do
|
|
154
154
|
:restricted => '',
|
155
155
|
:basic => '',
|
156
156
|
:relaxed => '<img>'
|
157
|
+
},
|
158
|
+
|
159
|
+
'protocol whitespace' => {
|
160
|
+
:html => '<a href=" http://example.com/"></a>',
|
161
|
+
:default => '',
|
162
|
+
:restricted => '',
|
163
|
+
:basic => '<a href="http://example.com/" rel="nofollow"></a>',
|
164
|
+
:relaxed => '<a href="http://example.com/"></a>'
|
157
165
|
}
|
158
166
|
}
|
159
167
|
|
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.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Grove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: crass
|
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: 1.2.0
|
166
166
|
requirements: []
|
167
167
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
168
|
+
rubygems_version: 2.4.5
|
169
169
|
signing_key:
|
170
170
|
specification_version: 4
|
171
171
|
summary: Whitelist-based HTML and CSS sanitizer.
|