Fix various Notices

This commit is contained in:
Philipp 2021-09-13 20:22:55 +02:00
parent 9b19fb9b4d
commit 644f312896
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
7 changed files with 12 additions and 10 deletions

View file

@ -2757,12 +2757,14 @@ class Contact
return null;
}
public static function removeFollower($importer, $contact)
public static function removeFollower(array $contact)
{
if (($contact['rel'] == self::FRIEND) || ($contact['rel'] == self::SHARING)) {
if (!empty($contact['rel']) && (($contact['rel'] == self::FRIEND) || ($contact['rel'] == self::SHARING))) {
DBA::update('contact', ['rel' => self::SHARING], ['id' => $contact['id']]);
} else {
} elseif (!empty($contact['id'])) {
self::remove($contact['id']);
} else {
DI::logger()->info('Couldn\'t remove follower because of invalid contact array', ['contact' => $contact]);
}
}

View file

@ -2292,9 +2292,9 @@ class Item
continue;
} elseif (!$expire_starred && intval($item['starred'])) {
continue;
} elseif (!$expire_notes && ($item['post-type'] == self::PT_PERSONAL_NOTE)) {
} elseif (!$expire_notes && (($item['post-type'] ?? null) == self::PT_PERSONAL_NOTE)) {
continue;
} elseif (!$expire_items && ($item['post-type'] != self::PT_PERSONAL_NOTE)) {
} elseif (!$expire_items && (($item['post-type'] ?? null) != self::PT_PERSONAL_NOTE)) {
continue;
}