From 06bf78bddd85cd97903fd90b846754c6f9a470dd Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 10 May 2021 23:34:20 -0700 Subject: [PATCH 1/2] Do not fetch recipient fields if they only contain a URI instead of an array. Use what is there. --- Zotlabs/Lib/ActivityStreams.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/ActivityStreams.php b/Zotlabs/Lib/ActivityStreams.php index 1e3405901..0564ef0f9 100644 --- a/Zotlabs/Lib/ActivityStreams.php +++ b/Zotlabs/Lib/ActivityStreams.php @@ -180,7 +180,8 @@ class ActivityStreams { $fields = [ 'to', 'cc', 'bto', 'bcc', 'audience']; foreach ($fields as $f) { - $y = $this->get_compound_property($f, $base, $namespace); + // don't expand these yet + $y = $this->get_property_obj($f, $base, $namespace); if ($y) { if (! is_array($this->raw_recips)) { $this->raw_recips = []; @@ -308,7 +309,7 @@ class ActivityStreams { * @return NULL|mixed */ - function fetch_property($url,$channel = null,$hub = null) { + function fetch_property($url,$channel = null,$hub = null) { return Activity::fetch($url,$channel,$hub); } From edd2737f56efb3f79fc8f9791f5af96507073961 Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 11 May 2021 14:06:59 -0700 Subject: [PATCH 2/2] fix posts to appendable collections arriving as normal posts if we don't host the target collection --- include/items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index a11e95f52..92f6a9180 100644 --- a/include/items.php +++ b/include/items.php @@ -2874,7 +2874,11 @@ function tgroup_check($uid, $item) { } if ($item['mid'] === $item['parent_mid'] && (! intval($item['item_wall'])) && (strpos($item['tgt_type'],'Collection') !== false) && $item['target']) { - return true; + // accept posts to collections only if the collection belongs to us + if ((is_string($item['target']) && strpos($item['target'],z_root()) !== false) + || (isset($item['target']['id']) && strpos($item['target']['id'],z_root()) !== false)) { + return true; + } } if (get_pconfig($uid,'system','post_via_mentions',in_array($role, ['forum','forum_moderated'])) && i_am_mentioned($u,$item)) {