about summary refs log tree commit diff
path: root/app/services/fetch_link_card_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-27 16:55:06 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-27 16:57:23 +0100
commit450ad431801b5f2c716041920842a9851b9d133c (patch)
tree06ecb71df5b2b36e9e125b62a70c4ca5504c8137 /app/services/fetch_link_card_service.rb
parent9f57c7d4a681a6563be267f728dab3603f75fe79 (diff)
Do not run FetchLinkCardService on local URLs, increase file size limit to 8MB,
fix ProcessFeedService pushing status into distribution if called a second time
while the first is still running (i.e. when a PuSH comes after a Salmon slap),
fix not running escape on spoiler text before emojify
Diffstat (limited to 'app/services/fetch_link_card_service.rb')
-rw-r--r--app/services/fetch_link_card_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index 005e5acea..1b94dfe0c 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -2,8 +2,8 @@
 
 class FetchLinkCardService < BaseService
   def call(status)
-    # Get first URL
-    url = URI.extract(status.text).reject { |uri| (uri =~ /\Ahttps?:\/\//).nil? }.first
+    # Get first http/https URL that isn't local
+    url = URI.extract(status.text).reject { |uri| (uri =~ /\Ahttps?:\/\//).nil? || TagManager.instance.local_url?(uri) }.first
 
     return if url.nil?