diff options
author | Mario <mario@mariovavti.com> | 2024-10-10 10:04:17 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-10-10 10:04:17 +0000 |
commit | 3cb5d14037e11f8a250d18b39eeae628b37ea75e (patch) | |
tree | c64678a1cb2c78b5b89d8f49f8d45704107429c2 | |
parent | 5f685bcf634519bf1f592bb13748f9e15d40df3a (diff) | |
download | volse-hubzilla-3cb5d14037e11f8a250d18b39eeae628b37ea75e.tar.gz volse-hubzilla-3cb5d14037e11f8a250d18b39eeae628b37ea75e.tar.bz2 volse-hubzilla-3cb5d14037e11f8a250d18b39eeae628b37ea75e.zip |
also discard Add/Remove at the AP side
(cherry picked from commit 2aee659cbdd147eca1c49385ea867ea11d2a72e5)
Co-authored-by: Mario Vavti <mario@mariovavti.com>
-rw-r--r-- | CHANGELOG | 4 | ||||
-rw-r--r-- | Zotlabs/Lib/Activity.php | 25 |
2 files changed, 22 insertions, 7 deletions
@@ -1,3 +1,7 @@ +Hubzilla 9.4.3 (2024-10-10) + - Discard Add/Remove activities (Hubzilla 10 and (streams) compatibility) + + Hubzilla 9.4.2 (2024-10-04) - Indicate reacted state via icon color (community wish) - Fix modal backdrop not removed when reacting from the modal diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 1ea42acd3..90d7af8e8 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3054,13 +3054,6 @@ class Activity { } $a = new ActivityStreams($n); - if ($a->type === 'Announce' && is_array($a->obj) - && array_key_exists('object', $a->obj) && array_key_exists('actor', $a->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); - $a = new ActivityStreams($a->obj); - } logger($a->debug(), LOGGER_DATA); @@ -3069,6 +3062,24 @@ class Activity { break; } + if (in_array($a->type, ['Add', 'Remove']) + && is_array($a->obj) + && array_key_exists('object', $a->obj) + && array_key_exists('actor', $a->obj) + && !empty($a->tgt)) { + + logger('unsupported collection operation', LOGGER_DEBUG); + return; + } + + if ($a->type === 'Announce' && is_array($a->obj) + && array_key_exists('object', $a->obj) && array_key_exists('actor', $a->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); + $a = new ActivityStreams($a->obj); + } + $item = Activity::decode_note($a); if (!$item) { |