1
1
Fork 0

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

Check for network key existence before calling Probe::isProbable in Model\Contact
This commit is contained in:
Michael Vogel 2022-09-24 20:01:17 +02:00 committed by GitHub
commit 260310e878
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3388,7 +3388,7 @@ class Contact
if (empty($contact['id']) && Network::isValidHttpUrl($url)) { if (empty($contact['id']) && Network::isValidHttpUrl($url)) {
Worker::add(PRIORITY_LOW, 'AddContact', 0, $url); Worker::add(PRIORITY_LOW, 'AddContact', 0, $url);
++$added; ++$added;
} elseif (Probe::isProbable($contact['network']) && ($contact['next-update'] < DateTimeFormat::utcNow())) { } elseif (!empty($contact['network']) && Probe::isProbable($contact['network']) && ($contact['next-update'] < DateTimeFormat::utcNow())) {
Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']); Worker::add(['priority' => PRIORITY_LOW, 'dont_fork' => true], 'UpdateContact', $contact['id']);
++$updated; ++$updated;
} else { } else {