From 88d2488d08ab34f28126fa4f30e19fa39e9cd882 Mon Sep 17 00:00:00 2001 From: Hawkheart Date: Thu, 4 Apr 2019 00:50:48 -0400 Subject: [PATCH 1/2] extend URL validation this code is currently dead, but improving it should it become live --- app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php b/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php index 90c592c5c..0d8dcffb3 100644 --- a/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php +++ b/app/Jobs/RemoteFollowPipeline/RemoteFollowImportRecent.php @@ -186,6 +186,11 @@ class RemoteFollowImportRecent implements ShouldQueue Log::info('Invalid media, skipping. '.$mime); continue; } + if (Helpers::validateUrl($url) == false) { + Log::info('Skipping invalid attachment URL: ' . $url); + continue; + } + $count++; if ($count === 1) { From 626bb4e700eb57eff3b96c1139135523e3b2a22b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 4 Apr 2019 13:42:12 -0600 Subject: [PATCH 2/2] Update FollowPipeline --- app/Jobs/FollowPipeline/FollowActivityPubDeliver.php | 2 +- app/Jobs/FollowPipeline/FollowPipeline.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Jobs/FollowPipeline/FollowActivityPubDeliver.php b/app/Jobs/FollowPipeline/FollowActivityPubDeliver.php index 56f22d99c..42006b27c 100644 --- a/app/Jobs/FollowPipeline/FollowActivityPubDeliver.php +++ b/app/Jobs/FollowPipeline/FollowActivityPubDeliver.php @@ -49,7 +49,7 @@ class FollowActivityPubDeliver implements ShouldQueue $actor = $follow->actor; $target = $follow->target; - if($target->domain == null || $target->inbox_url == null) { + if($target->domain == null || $target->inbox_url == null || !$actor->private_key) { return; } diff --git a/app/Jobs/FollowPipeline/FollowPipeline.php b/app/Jobs/FollowPipeline/FollowPipeline.php index ec6c7ecb8..17ad47889 100644 --- a/app/Jobs/FollowPipeline/FollowPipeline.php +++ b/app/Jobs/FollowPipeline/FollowPipeline.php @@ -46,6 +46,10 @@ class FollowPipeline implements ShouldQueue $actor = $follower->actor; $target = $follower->target; + if($target->domain || !$target->private_key) { + return; + } + try { $notification = new Notification(); $notification->profile_id = $target->id;