about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-22 19:55:14 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-22 19:55:14 +0100
commit53ae431867cbb5f8c49f6123dcae530ee472ee71 (patch)
treeaec77e4452971dec751b88607a49c247bbf5dbe7 /app/services
parent3202bdd74416035f81170e978129bbffb3151ed2 (diff)
Skip remote media URLs that don't have a hostname
Diffstat (limited to 'app/services')
-rw-r--r--app/services/process_feed_service.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/services/process_feed_service.rb b/app/services/process_feed_service.rb
index f0a62aa14..5d952df6f 100644
--- a/app/services/process_feed_service.rb
+++ b/app/services/process_feed_service.rb
@@ -181,6 +181,9 @@ class ProcessFeedService < BaseService
         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'])
+        parsed_url = URI.parse(link['href'])
+
+        next if !%w(http https).include?(parsed_url.scheme) || parsed_url.host.empty?
 
         begin
           media.file_remote_url = link['href']