Continued:

- changed back to 'return false;' as other methods heavily rely on false instead
  of an empty array as pointed out by @heluecht@pirati.ca
- $fetched_contact should be initialized as an empty array, let's not make this
  code more crazier than it already is (see APContact::getByURL())
This commit is contained in:
Roland Häder 2022-06-17 11:48:52 +02:00
parent c467bff79f
commit 36d56a4041
3 changed files with 17 additions and 16 deletions

View file

@ -124,7 +124,7 @@ class APContact
return [];
}
$fetched_contact = false;
$fetched_contact = [];
if (empty($update)) {
if (is_null($update)) {
@ -206,7 +206,7 @@ class APContact
if ($failed) {
self::markForArchival($fetched_contact ?: []);
return $fetched_contact ?? [];
return $fetched_contact;
}
}
@ -275,7 +275,7 @@ class APContact
// Quit if none of the basic values are set
if (empty($apcontact['url']) || empty($apcontact['type']) || (($apcontact['type'] != 'Tombstone') && empty($apcontact['inbox']))) {
return $fetched_contact ?? [];
return $fetched_contact;
} elseif ($apcontact['type'] == 'Tombstone') {
// The "inbox" field must have a content
$apcontact['inbox'] = '';
@ -283,7 +283,7 @@ class APContact
// Quit if this doesn't seem to be an account at all
if (!in_array($apcontact['type'], ActivityPub::ACCOUNT_TYPES)) {
return $fetched_contact ?? [];
return $fetched_contact;
}
$parts = parse_url($apcontact['url']);