X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FHTTPSignature.php;h=e2de810a606a32c8b33c2ac812e6e859accada65;hb=51ebb1541a62c0fd691d995326d61775cc7d61d3;hp=5fb4ab7337b93ddcd886302a7392e44d77ded320;hpb=4d0e6305dd25c25d10a99dcba349bc8cea68831c;p=friendica.git diff --git a/src/Util/HTTPSignature.php b/src/Util/HTTPSignature.php index 5fb4ab7337..e2de810a60 100644 --- a/src/Util/HTTPSignature.php +++ b/src/Util/HTTPSignature.php @@ -28,6 +28,7 @@ use Friendica\DI; use Friendica\Model\APContact; use Friendica\Model\Contact; use Friendica\Model\User; +use Friendica\Network\CurlResult; /** * Implements HTTP Signatures per draft-cavage-http-signatures-07. @@ -408,7 +409,7 @@ class HTTPSignature * 'nobody' => only return the header * 'cookiejar' => path to cookie jar file * - * @return object CurlResult + * @return CurlResult CurlResult * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function fetchRaw($request, $uid = 0, $opts = ['accept_content' => 'application/activity+json, application/ld+json']) @@ -558,8 +559,10 @@ class HTTPSignature if (!empty($key['url']) && !empty($key['type']) && ($key['type'] == 'Tombstone')) { Logger::info('Actor is a tombstone', ['key' => $key]); - // We now delete everything that we possibly knew from this actor - Contact::deleteContactByUrl($key['url']); + if (!Contact::isLocal($key['url'])) { + // We now delete everything that we possibly knew from this actor + Contact::deleteContactByUrl($key['url']); + } return null; } @@ -638,16 +641,17 @@ class HTTPSignature $profile = APContact::getByURL($url); 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']]; } elseif ($url != $actor) { $profile = APContact::getByURL($actor); 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']]; } } + Logger::notice('Key could not be fetched', ['url' => $url, 'actor' => $actor]); return false; } }