url_scrubber 0.8.10 → 0.8.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWUxZDdlODMwOWZmMjllMDYzYzhlYjM5NzU5NGI4MWNjYTU1ZDM3Yw==
4
+ ZmJkNTc2MWQ5NmU0NWNkMTZhMmE1NDZmOTFmMGRjOGE4NDc3ZjJkMA==
5
5
  data.tar.gz: !binary |-
6
- Y2UyZTBhZjFkOGQyNzYzZDhmNjU2MDUyZWVlYjIxYmQzODMxNDU1Ng==
6
+ NmYzMDIzNTE1OGIxZWM3ZTRhZmE0NGE2NzI2YmIzZWIzZDJhNWQ0ZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjM4MDI1OTdkODc0OGQ3YTE4NDAwNDk3Y2JlYzhhOGIzYmRhYmIwNzE2MWM4
10
- NTc5N2M4ZjdmZDdlMmMyYjQwMmE2MjliOTY3YzBlNTAzMGNhYTZkN2E2YmVh
11
- MTBiMWUwMDEzZTA2M2E5MGNkMmU3YWM2NDE0NzkwZDg3YTYzZDg=
9
+ ZWZjMGY0YmVhZDM3OThhZjExNDAzMWUyYzlkYjdlMzg3N2Q0MWM0MGM3ZTkx
10
+ MWY2Yzk1Y2FmZTMyODVhNjFlMDg2OWU0ODc5OTQ0N2ViZGEyMTNhZmQyNDU2
11
+ NmI2MmE5NzRmMzQ2YWYyY2I1N2IyMTU3ZWQzYzU1ZGM3YWZiMTY=
12
12
  data.tar.gz: !binary |-
13
- MDU4YjQ1MWU0NDgyZTFjMjRhODJiOWNhYWJhMzAxNzQyNzQ4ZjliYTI3YjRh
14
- YWMwMTA0MDhmMWE0MzE3NmRlYTBiZmE4MzU4MDc2YzJkNWUwMjEzN2FiYmQ5
15
- YTU3Y2E2YzczYzJjYWZmYzNlY2FjMzUwMTVmNjk5NzE3ZTRhYzg=
13
+ YzBkOTY2YjQ0ZDFiOGViNGEzNDMxYzM2YmVhYWZkMWFkMWZkOTg3ZGY4YTFj
14
+ NWIyZmI0N2E3ZDZlZGQ4OWZlYThiMzhlMWFiNWZkOTBhMzYxZTdmMjkxM2U0
15
+ ZjZkNDAxZjU2NDY3OGUwZjk2MDQxN2IyZjE0YzRiYjUwMTRmYmU=
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.8.10"
2
+ VERSION = "0.8.12"
3
3
  end
data/lib/url_scrubber.rb CHANGED
@@ -152,7 +152,7 @@ module UrlScrubber
152
152
  # 3. valid uri as determined by Addressable::URI
153
153
  def self.valid_url?(url)
154
154
  schemes = %w(http https)
155
- parsed = URI.parse(url) or return false
155
+ parsed = URI.parse(URI.escape(url)) or return false
156
156
  schemes.include?(parsed.scheme) && !url.include?("@")
157
157
  rescue URI::InvalidURIError
158
158
  false
@@ -161,7 +161,7 @@ module UrlScrubber
161
161
 
162
162
  def self.maps_to_public_url(url)
163
163
  scrubbed = scrub(url)
164
- parsed = URI.parse(url) or return nil
164
+ parsed = URI.parse(URI.escape(url)) or return nil
165
165
  host = Domainatrix.parse(parsed.host)
166
166
  if host.domain == "facebook" && host.subdomain == "business"
167
167
  public_url = scrubbed.sub("http://business.facebook.com", "http://facebook.com")
@@ -436,7 +436,7 @@ module UrlScrubber
436
436
  uri_str_new = uri_str_new.sub('https://', 'https://www.') if !uri_str_new.include?("https://www.")
437
437
 
438
438
  begin
439
- url = URI.parse(uri_str_new)
439
+ url = URI.parse(URI.escape(uri_str_new))
440
440
  rescue URI::InvalidURIError => e
441
441
  return [uri_str_new, CustomError.new(786, "Invalid URI #{uri_str_new} : #{e.message}") ]
442
442
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_scrubber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.10
4
+ version: 0.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Langton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-03-12 00:00:00.000000000 Z
14
+ date: 2018-05-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec