From ded5a0ac6a91cf196fc90bad191bfa3a283ccf72 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Sep 2022 09:56:12 -0400 Subject: [PATCH] Ward against missing keys in Model\APContact::isRelay - Address https://github.com/friendica/friendica/issues/11632#issuecomment-1231904280 --- src/Model/APContact.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/APContact.php b/src/Model/APContact.php index 0448765d0..043f33c31 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -577,15 +577,15 @@ class APContact */ public static function isRelay(array $apcontact): bool { - if ($apcontact['nick'] != 'relay') { + if (empty($apcontact['nick']) || $apcontact['nick'] != 'relay') { return false; } - if ($apcontact['type'] == 'Application') { + if (!empty($apcontact['type']) && $apcontact['type'] == 'Application') { return true; } - if (in_array($apcontact['type'], ['Group', 'Service']) && is_null($apcontact['outbox'])) { + if (!empty($apcontact['type']) && in_array($apcontact['type'], ['Group', 'Service']) && is_null($apcontact['outbox'])) { return true; }