Merge pull request #10320 from annando/notice
Avoid notices because of empty fields
This commit is contained in:
commit
91b474ea6d
|
@ -361,7 +361,7 @@ class APContact
|
||||||
|
|
||||||
Logger::info('Updated profile', ['url' => $url]);
|
Logger::info('Updated profile', ['url' => $url]);
|
||||||
|
|
||||||
return $apcontact;
|
return DBA::selectFirst('apcontact', [], ['url' => $apcontact['url']]) ?: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -640,16 +640,17 @@ class HTTPSignature
|
||||||
|
|
||||||
$profile = APContact::getByURL($url);
|
$profile = APContact::getByURL($url);
|
||||||
if (!empty($profile)) {
|
if (!empty($profile)) {
|
||||||
Logger::log('Taking key from id ' . $id, Logger::DEBUG);
|
Logger::info('Taking key from id', ['id' => $id]);
|
||||||
return ['url' => $url, 'pubkey' => $profile['pubkey'], 'type' => $profile['type']];
|
return ['url' => $url, 'pubkey' => $profile['pubkey'], 'type' => $profile['type']];
|
||||||
} elseif ($url != $actor) {
|
} elseif ($url != $actor) {
|
||||||
$profile = APContact::getByURL($actor);
|
$profile = APContact::getByURL($actor);
|
||||||
if (!empty($profile)) {
|
if (!empty($profile)) {
|
||||||
Logger::log('Taking key from actor ' . $actor, Logger::DEBUG);
|
Logger::info('Taking key from actor', ['actor' => $actor]);
|
||||||
return ['url' => $actor, 'pubkey' => $profile['pubkey'], 'type' => $profile['type']];
|
return ['url' => $actor, 'pubkey' => $profile['pubkey'], 'type' => $profile['type']];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger::notice('Key could not be fetched', ['url' => $url, 'actor' => $actor]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user