From 60c7bc90e6c622161d61fca4a3545eabceec1abf Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 23 Jul 2023 13:59:01 +0000 Subject: [PATCH] Removed unneeded check --- src/Protocol/ActivityPub.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Protocol/ActivityPub.php b/src/Protocol/ActivityPub.php index 152cca98a..570348be2 100644 --- a/src/Protocol/ActivityPub.php +++ b/src/Protocol/ActivityPub.php @@ -29,7 +29,6 @@ use Friendica\Model\Contact; use Friendica\Model\User; use Friendica\Util\HTTPSignature; use Friendica\Util\JsonLD; -use Friendica\Util\Network; /** * ActivityPub Protocol class @@ -287,13 +286,13 @@ class ActivityPub $signer = HTTPSignature::getSigner('', $_SERVER); if (!$signer) { - Logger::debug('No signer', ['uid' => $uid, 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'called_by' => $called_by]); + Logger::debug('No signer or invalid signature', ['uid' => $uid, 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '', 'called_by' => $called_by]); return false; } $apcontact = APContact::getByURL($signer); if (empty($apcontact)) { - Logger::debug('APContact not found', ['uid' => $uid, 'handle' => $signer, 'called_by' => $called_by]); + Logger::info('APContact not found', ['uid' => $uid, 'handle' => $signer, 'called_by' => $called_by]); return false; } @@ -302,12 +301,6 @@ class ActivityPub return false; } - // Check added as a precaution. It should not occur. - if (Network::isUrlBlocked($apcontact['baseurl'])) { - Logger::info('Requesting domain is blocked', ['uid' => $uid, 'id' => $apcontact['gsid'], 'url' => $apcontact['baseurl'], 'signer' => $signer, 'called_by' => $called_by]); - return false; - } - $contact = Contact::getByURL($signer, false, ['id', 'baseurl', 'gsid']); if (!empty($contact) && Contact\User::isBlocked($contact['id'], $uid)) { Logger::info('Requesting contact is blocked', ['uid' => $uid, 'id' => $contact['id'], 'signer' => $signer, 'baseurl' => $contact['baseurl'], 'called_by' => $called_by]);