Merge branch 'dev' into collect

This commit is contained in:
Mike Macgirvin 2024-01-31 20:33:02 +11:00
commit 85dd35848d

View file

@ -1200,6 +1200,7 @@ class Libzot
if ($env['encoding'] === 'activitystreams') {
$AS = new ActivityStreams($data, portable_id: $env['sender']);
<<<<<<< HEAD
if ($AS->is_valid()) {
if ($AS->type === 'Announce' && is_array($AS->obj)
@ -1225,6 +1226,18 @@ class Libzot
}
}
else {
=======
if (
$AS->is_valid() && $AS->type === 'Announce' && is_array($AS->obj)
&& array_key_exists('object', $AS->obj) && array_key_exists('actor', $AS->obj)
) {
// This is a relayed/forwarded Activity (as opposed to a shared/boosted object)
// Reparse the encapsulated Activity and use that instead
logger('relayed activity', LOGGER_DEBUG);
$AS = new ActivityStreams($AS->obj, portable_id: $env['sender']);
}
if (!$AS->is_valid()) {
>>>>>>> dev
logger('Activity rejected: ' . print_r($data, true));
return false;
}