diff options
author | ThibG <thib@sitedethib.com> | 2019-11-24 00:36:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-24 00:36:35 +0100 |
commit | 2448568d341dcf288bf004826666ab9010601b47 (patch) | |
tree | 2df762b1b6d46f64f97991a70267d96a4509cdd1 /app/services | |
parent | 55f5e81a9dc4c6cede5d43e549061be2ea9be614 (diff) | |
parent | 271b2e68f33e8086eb4a1ee44694fcd2ecd7ab07 (diff) |
Merge pull request #1247 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/block_domain_service.rb | 4 | ||||
-rw-r--r-- | app/services/fetch_link_card_service.rb | 2 | ||||
-rw-r--r-- | app/services/fetch_oembed_service.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/app/services/block_domain_service.rb b/app/services/block_domain_service.rb index ae461abf2..9f0860674 100644 --- a/app/services/block_domain_service.rb +++ b/app/services/block_domain_service.rb @@ -20,13 +20,13 @@ class BlockDomainService < BaseService end def process_domain_block! - clear_media! if domain_block.reject_media? - if domain_block.silence? silence_accounts! elsif domain_block.suspend? suspend_accounts! end + + clear_media! if domain_block.reject_media? end def invalidate_association_caches! diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb index 29880e8d8..5d4a7c303 100644 --- a/app/services/fetch_link_card_service.rb +++ b/app/services/fetch_link_card_service.rb @@ -67,7 +67,7 @@ class FetchLinkCardService < BaseService else html = Nokogiri::HTML(@status.text) links = html.css('a') - urls = links.map { |a| Addressable::URI.parse(a['href']).normalize unless skip_link?(a) }.compact + urls = links.map { |a| Addressable::URI.parse(a['href']) unless skip_link?(a) }.compact.map(&:normalize).compact end urls.reject { |uri| bad_url?(uri) }.first diff --git a/app/services/fetch_oembed_service.rb b/app/services/fetch_oembed_service.rb index 4f8498c62..76d971bc5 100644 --- a/app/services/fetch_oembed_service.rb +++ b/app/services/fetch_oembed_service.rb @@ -58,7 +58,7 @@ class FetchOEmbedService url_domain = Addressable::URI.parse(@url).normalized_host endpoint_hash = { - endpoint: @endpoint_url.gsub(URI.encode_www_form_component(@url), '{url}'), + endpoint: @endpoint_url.gsub(/(=(http[s]?(%3A|:)(\/\/|%2F%2F)))([^&]*)/i, '={url}'), format: @format, } |