Merge pull request #7767 from MrPetovan/bug/fatal-errors

Expect outbox->first to be a Link structure in Model\GContact
This commit is contained in:
Philipp 2019-10-25 08:46:42 +02:00 committed by GitHub
commit b34afa990b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -859,7 +859,9 @@ class GContact
/** /**
* Update a global contact via an ActivityPub Outbox * Update a global contact via an ActivityPub Outbox
* *
* @param string $data Probing result * @param string $feed
* @param array $data Probing result
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */
private static function updateFromOutbox(string $feed, array $data) private static function updateFromOutbox(string $feed, array $data)
{ {
@ -872,6 +874,9 @@ class GContact
$items = $outbox['orderedItems']; $items = $outbox['orderedItems'];
} elseif (!empty($outbox['first']['orderedItems'])) { } elseif (!empty($outbox['first']['orderedItems'])) {
$items = $outbox['first']['orderedItems']; $items = $outbox['first']['orderedItems'];
} elseif (!empty($outbox['first']['href'])) {
self::updateFromOutbox($outbox['first']['href'], $data);
return;
} elseif (!empty($outbox['first'])) { } elseif (!empty($outbox['first'])) {
self::updateFromOutbox($outbox['first'], $data); self::updateFromOutbox($outbox['first'], $data);
return; return;