From 654b08d382bbbff9146b4bd45302c5443c46130e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 25 Jan 2021 21:44:07 -0700 Subject: [PATCH] Update ActivityPubFetchService, add url validation --- app/Services/ActivityPubFetchService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/ActivityPubFetchService.php b/app/Services/ActivityPubFetchService.php index b6b8202e4..94e9357a3 100644 --- a/app/Services/ActivityPubFetchService.php +++ b/app/Services/ActivityPubFetchService.php @@ -11,6 +11,10 @@ class ActivityPubFetchService { public static function get($url) { + if(!Helpers::validateUrl($url)) { + return 0; + } + $headers = HttpSignature::instanceActorSign($url, false, [ 'Accept' => 'application/activity+json, application/json', 'User-Agent' => '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')'