forked from fedi/mastodon
Skip remote media URLs that don't have a hostname
This commit is contained in:
parent
3202bdd744
commit
53ae431867
|
@ -138,7 +138,7 @@ class Account < ApplicationRecord
|
||||||
def avatar_remote_url=(url)
|
def avatar_remote_url=(url)
|
||||||
parsed_url = URI.parse(url)
|
parsed_url = URI.parse(url)
|
||||||
|
|
||||||
return if !%w(http https).include?(parsed_url.scheme) || self[:avatar_remote_url] == url
|
return if !%w(http https).include?(parsed_url.scheme) || parsed_url.host.empty? || self[:avatar_remote_url] == url
|
||||||
|
|
||||||
self.avatar = parsed_url
|
self.avatar = parsed_url
|
||||||
self[:avatar_remote_url] = url
|
self[:avatar_remote_url] = url
|
||||||
|
|
|
@ -181,6 +181,9 @@ class ProcessFeedService < BaseService
|
||||||
next unless link['href']
|
next unless link['href']
|
||||||
|
|
||||||
media = MediaAttachment.where(status: parent, remote_url: link['href']).first_or_initialize(account: parent.account, status: parent, remote_url: link['href'])
|
media = MediaAttachment.where(status: parent, remote_url: link['href']).first_or_initialize(account: parent.account, status: parent, remote_url: link['href'])
|
||||||
|
parsed_url = URI.parse(link['href'])
|
||||||
|
|
||||||
|
next if !%w(http https).include?(parsed_url.scheme) || parsed_url.host.empty?
|
||||||
|
|
||||||
begin
|
begin
|
||||||
media.file_remote_url = link['href']
|
media.file_remote_url = link['href']
|
||||||
|
|
Loading…
Reference in a new issue