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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04116455cb1ededd3413abade63532f93664c741
4
- data.tar.gz: 608d034be8d8b305407f87be7e439e00917a1e62
3
+ metadata.gz: ba375648ad289cc08ce45eafc47ed464ce6e7f9e
4
+ data.tar.gz: 88022411ca58369ad7f0699f022c67c344891e69
5
5
  SHA512:
6
- metadata.gz: d79b43a450dbc1336a9e648f2f33c8675da87dea4068784bafe56b0a71b9b2f11810a660657336a5ace1b7d406bcf9f1a0b16894d9d5bfd000d2ad1ec4bb326c
7
- data.tar.gz: 5f800eafba144631a99b94f71de49cbf323bf6548ef3b19c2c019718b1d127743007ef9c53c28b2447a4faf89fcfd95fdd996491d6f582aeb95d648d7ccfede1
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
 
@@ -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([^\/#]*?)(?:\:|&#0*58|&#x0*3a)/i
27
+ REGEX_PROTOCOL = /\A\s*([^\/#]*?)(?:\:|&#0*58|&#x0*3a)/i
28
28
 
29
29
  # Matches Unicode characters that should be stripped from HTML before passing
30
30
  # it to the parser.
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  class Sanitize
4
- VERSION = '3.0.3'
4
+ VERSION = '3.0.4'
5
5
  end
@@ -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.3
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-10-29 00:00:00.000000000 Z
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.2.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.