From 96f1cc1a5cb56b4ba186d3b260d2f75d662630bc Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Mon, 14 Sep 2020 21:32:41 +0300 Subject: [PATCH] [ActivityPub][INBOX][Delete] Stop if the ID is not present --- plugins/ActivityPub/lib/inbox_handler.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ActivityPub/lib/inbox_handler.php b/plugins/ActivityPub/lib/inbox_handler.php index 215bc6c187..bbc28c6aad 100644 --- a/plugins/ActivityPub/lib/inbox_handler.php +++ b/plugins/ActivityPub/lib/inbox_handler.php @@ -275,10 +275,13 @@ class Activitypub_inbox_handler // If it's gone, we don't know the type of the deleted object, we only have a Tombstone // If we were given an array, we don't know if it's Gone or not via status code... // In both cases, we will want to fetch the ID and act on that as it is easier than updating the fields + $object = $object['id'] ?? null; + if (is_null($object)) { + return; + } // Was it a profile? try { - $object = $object['id']; $aprofile = Activitypub_profile::fromUri($object, false); $res = Activitypub_explorer::get_remote_user_activity($object); Activitypub_profile::update_profile($aprofile, $res); @@ -291,7 +294,7 @@ class Activitypub_inbox_handler try { $client = new HTTPClient(); /*$response =*/ $client->get($object, ACTIVITYPUB_HTTP_CLIENT_HEADERS); - // If it was deleted + // If it were deleted //if (!$response->isOk()) { // 410 or 404 $notice = ActivityPubPlugin::grab_notice_from_url($object, false); if ($notice instanceof Notice) {