onebox 2.2.6 → 2.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43221e11b40d179b5a90c7c84f6c79096ba999b06ab411d159668c775de75e99
4
- data.tar.gz: f23358a13d9644974b3e266f5acfd32eb13e113e085a4806369f2f858397e425
3
+ metadata.gz: 5899faff4b0c2e96d766892a810e866e28a188dbd7b9e8b2c7bdd6bc5a7d7490
4
+ data.tar.gz: 7d739d48349f32dc3f0675d85b29446d6f758f276b845543cc9f9d359c9eb664
5
5
  SHA512:
6
- metadata.gz: 290c2d0fbc5b6e2f3a4a4557e82cf6f509b8756d4c56be587af86cf95bd5c9cd58ba01e5b266b29268723941efbd542d03d89afa92bf08f0a8c87b42752e03c8
7
- data.tar.gz: 5497119a20088d0b09fe69b172926ba60318cf4145a174bac66f8ef781fc7465e6cf0e9524f94156633cb605d3e9081f62697b641ce3e514c2cfc74d2a8026f3
6
+ metadata.gz: 790964df42c83ea05ff052727a7ad4b567f6064be1a25bf974eeac661a6f7daa3696c64686f21bb83df30ad280caffc36b2039e3c0b799a3171713d61c88eff2
7
+ data.tar.gz: de30b5e5e6110fd72c0aa792aebffa7571c50f04604efedac648e754a527f4945a784328eb43ce0352e9b06eeac908ea23ff0dcdf3ce4d84ecb5e8c3dd64dfd6
@@ -44,6 +44,6 @@ jobs:
44
44
  - uses: actions/checkout@v2
45
45
 
46
46
  - name: Release Gem
47
- uses: CvX/publish-rubygems-action@master
47
+ uses: discourse/publish-rubygems-action@main
48
48
  env:
49
49
  RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
@@ -227,8 +227,10 @@ module Onebox
227
227
  d[:image] = d[:image_secure_url] || d[:image_url] || d[:thumbnail_url] || d[:image]
228
228
  d[:image] = Onebox::Helpers::get_absolute_image_url(d[:image], @url)
229
229
  d[:image] = Onebox::Helpers::normalize_url_for_output(html_entities.decode(d[:image]))
230
+ d[:image] = nil if Onebox::Helpers.blank?(d[:image])
230
231
 
231
232
  d[:video] = d[:video_secure_url] || d[:video_url] || d[:video]
233
+ d[:video] = nil if Onebox::Helpers.blank?(d[:video])
232
234
 
233
235
  d[:published_time] = d[:article_published_time] unless Onebox::Helpers.blank?(d[:article_published_time])
234
236
  if !Onebox::Helpers.blank?(d[:published_time])
@@ -28,7 +28,7 @@ module Onebox
28
28
  def http_params
29
29
  {
30
30
  'User-Agent' =>
31
- 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3'
31
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'
32
32
  }
33
33
  end
34
34
 
@@ -178,6 +178,10 @@ module Onebox
178
178
  url.gsub!("'", "'")
179
179
  url.gsub!('"', """)
180
180
  url.gsub!(/[^\w\-`.~:\/?#\[\]@!$&'\(\)*+,;=%\p{M}’]/, "")
181
+
182
+ parsed = Addressable::URI.parse(url)
183
+ return "" unless parsed.host
184
+
181
185
  url
182
186
  end
183
187
 
@@ -32,7 +32,8 @@ module Onebox
32
32
  if method_name.end_with?(*integer_suffixes)
33
33
  value.to_i
34
34
  elsif method_name.end_with?(*url_suffixes)
35
- ::Onebox::Helpers.normalize_url_for_output(value)
35
+ result = Onebox::Helpers.normalize_url_for_output(value)
36
+ result unless Onebox::Helpers::blank?(result)
36
37
  else
37
38
  value
38
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onebox
4
- VERSION = "2.2.6"
4
+ VERSION = "2.2.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-02-25 00:00:00.000000000 Z
13
+ date: 2021-03-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable