diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 84eaadfe5e..0ebd616089 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -122,8 +122,8 @@ class Statuses extends BaseApi $existing_media = array_column(Post\Media::getByURIId($post['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::IMAGE]), 'id'); foreach ($request['media_attributes'] as $attributes) { - if (in_array($attributes['id'], $existing_media)) { - Post\Media::updateById(['description' => $attributes['description']], $attributes['id']); + if (!empty($attributes['id']) && in_array($attributes['id'], $existing_media)) { + Post\Media::updateById(['description' => $attributes['description'] ?? null], $attributes['id']); } } @@ -227,7 +227,7 @@ class Statuses extends BaseApi break; } } - + if (!empty($owner['allow_cid'] . $owner['allow_gid'] . $owner['deny_cid'] . $owner['deny_gid'])) { $item['allow_cid'] = $owner['allow_cid']; $item['allow_gid'] = $owner['allow_gid']; @@ -306,7 +306,7 @@ class Statuses extends BaseApi } $item = DI::contentItem()->expandTags($item, $request['visibility'] == 'direct'); - + if (!empty($request['media_ids'])) { $item = $this->storeMediaIds($request['media_ids'], $item); } diff --git a/src/Protocol/ActivityPub/Receiver.php b/src/Protocol/ActivityPub/Receiver.php index 933b9be438..ff78f0db82 100644 --- a/src/Protocol/ActivityPub/Receiver.php +++ b/src/Protocol/ActivityPub/Receiver.php @@ -1213,7 +1213,7 @@ class Receiver } // Fetch the receivers for the public and the followers collection - if ((($receiver == $followers) || (($receiver == self::PUBLIC_COLLECTION) && !$isGroup) || ($isGroup && ($element == 'as:audience'))) && !empty($actor)) { + if ((($receiver == $followers) || (($receiver == self::PUBLIC_COLLECTION) && !$isGroup) || ($isGroup && ($element == 'as:audience'))) && !empty($profile)) { $receivers = self::getReceiverForActor($tags, $receivers, $follower_target, $profile); continue; }