Merge pull request #11922 from MrPetovan/bug/notices

Ward against missing keys in Model\APContact::isRelay
This commit is contained in:
Michael Vogel 2022-09-24 20:02:21 +02:00 committed by GitHub
commit b00947025a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -577,15 +577,15 @@ class APContact
*/ */
public static function isRelay(array $apcontact): bool public static function isRelay(array $apcontact): bool
{ {
if ($apcontact['nick'] != 'relay') { if (empty($apcontact['nick']) || $apcontact['nick'] != 'relay') {
return false; return false;
} }
if ($apcontact['type'] == 'Application') { if (!empty($apcontact['type']) && $apcontact['type'] == 'Application') {
return true; 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; return true;
} }