浏览代码

Update InboxPipeline, fixes #3306

Daniel Supernault 3 年之前
父节点
当前提交
20710f4d6e
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 3 0
      app/Jobs/InboxPipeline/InboxValidator.php
  2. 3 0
      app/Jobs/InboxPipeline/InboxWorker.php

+ 3 - 0
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;
         }

+ 3 - 0
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;
         }