]> git.mxchange.org Git - friendica.git/commitdiff
Removed unneeded check
authorMichael <heluecht@pirati.ca>
Sun, 23 Jul 2023 13:59:01 +0000 (13:59 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 23 Jul 2023 13:59:01 +0000 (13:59 +0000)
src/Protocol/ActivityPub.php

index 152cca98aa8e7da32be867f88b0ad8f9b25f361a..570348be242d7487599950a4b2a39a6cacbb3351 100644 (file)
@@ -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]);