Removed unneeded check

This commit is contained in:
Michael 2023-07-23 13:59:01 +00:00
parent f0563df991
commit 60c7bc90e6

View File

@ -29,7 +29,6 @@ use Friendica\Model\Contact;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Util\HTTPSignature; use Friendica\Util\HTTPSignature;
use Friendica\Util\JsonLD; use Friendica\Util\JsonLD;
use Friendica\Util\Network;
/** /**
* ActivityPub Protocol class * ActivityPub Protocol class
@ -287,13 +286,13 @@ class ActivityPub
$signer = HTTPSignature::getSigner('', $_SERVER); $signer = HTTPSignature::getSigner('', $_SERVER);
if (!$signer) { 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; return false;
} }
$apcontact = APContact::getByURL($signer); $apcontact = APContact::getByURL($signer);
if (empty($apcontact)) { 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; return false;
} }
@ -302,12 +301,6 @@ class ActivityPub
return false; 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']); $contact = Contact::getByURL($signer, false, ['id', 'baseurl', 'gsid']);
if (!empty($contact) && Contact\User::isBlocked($contact['id'], $uid)) { 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]); Logger::info('Requesting contact is blocked', ['uid' => $uid, 'id' => $contact['id'], 'signer' => $signer, 'baseurl' => $contact['baseurl'], 'called_by' => $called_by]);