1
0
Fork 0

Merge pull request #8413 from annando/fix-warning

Avoid notice in gcontact.php
This commit is contained in:
Hypolite Petovan 2020-03-12 17:16:59 -04:00 committed by GitHub
commit d92b9a79e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1343,14 +1343,18 @@ class GContact
foreach ($contacts as $contact) {
$gcontact = DBA::selectFirst('gcontact', ['id'], ['nurl' => Strings::normaliseLink(($contact))]);
if (DBA::isResult($gcontact)) {
$fields = [];
if (in_array($contact, $followers)) {
$fields = ['gcid' => $gcid, 'follower-gcid' => $gcontact['id']];
} elseif (in_array($contact, $followings)) {
$fields = ['gcid' => $gcontact['id'], 'follower-gcid' => $gcid];
}
Logger::info('Set relation between contacts', $fields);
DBA::update('gfollower', ['deleted' => false], $fields, true);
continue;
if (!empty($fields)) {
Logger::info('Set relation between contacts', $fields);
DBA::update('gfollower', ['deleted' => false], $fields, true);
continue;
}
}
if (!Network::isUrlBlocked($contact)) {