This commit is contained in:
Michael Vogel 2025-06-06 08:27:08 +02:00 committed by GitHub
commit 6dfa1809d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -644,16 +644,19 @@ class Receiver
return true; return true;
} }
} else { } else {
$attributed_to = ''; $attributed_to = null;
} }
// Test the provided signatures against the actor and "attributedTo" // Test the provided signatures against the actor and "attributedTo"
if ($trust_source) { if ($trust_source) {
if ($attributed_to !== false && $attributed_to !== '') { if (!is_null($attributed_to)) {
$trust_source = (in_array($actor, $signer) && in_array($attributed_to, $signer)); $trust_source = (in_array($actor, $signer) && in_array($attributed_to, $signer));
} else { } else {
$trust_source = in_array($actor, $signer); $trust_source = in_array($actor, $signer);
} }
if (!$trust_source) {
DI::logger()->info('Actor missmatch. Activity trust could not be achieved.', ['type' => $type, 'signer' => $signer, 'actor' => $actor, 'attributedTo' => $attributed_to]);
}
} }
// Lemmy announces activities. // Lemmy announces activities.