From 20710f4d6e13ab7998ddfec5621f1d15464fedf9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 12 Mar 2022 23:49:11 -0700 Subject: [PATCH] Update InboxPipeline, fixes #3306 --- app/Jobs/InboxPipeline/InboxValidator.php | 3 +++ app/Jobs/InboxPipeline/InboxWorker.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/Jobs/InboxPipeline/InboxValidator.php b/app/Jobs/InboxPipeline/InboxValidator.php index 4b85a1bd..bfc3457d 100644 --- a/app/Jobs/InboxPipeline/InboxValidator.php +++ b/app/Jobs/InboxPipeline/InboxValidator.php @@ -223,6 +223,9 @@ class InboxValidator implements ShouldQueue 'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org', ])->get($actor->remote_url); $res = json_decode($res->body(), true, 8); + if(!$res || empty($res) || !isset($res['publicKey']) || !isset($res['publicKey']['id'])) { + return; + } if($res['publicKey']['id'] !== $actor->key_id) { return; } diff --git a/app/Jobs/InboxPipeline/InboxWorker.php b/app/Jobs/InboxPipeline/InboxWorker.php index ad3a085b..a888fd3c 100644 --- a/app/Jobs/InboxPipeline/InboxWorker.php +++ b/app/Jobs/InboxPipeline/InboxWorker.php @@ -211,6 +211,9 @@ class InboxWorker implements ShouldQueue 'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org', ])->get($actor->remote_url); $res = json_decode($res->body(), true, 8); + if(!$res || empty($res) || !isset($res['publicKey']) || !isset($res['publicKey']['id'])) { + return; + } if($res['publicKey']['id'] !== $actor->key_id) { return; }