diff --git a/src/Entity/Activity.php b/src/Entity/Activity.php index 0da1ad3b7a..938633c0c2 100644 --- a/src/Entity/Activity.php +++ b/src/Entity/Activity.php @@ -187,7 +187,8 @@ class Activity extends Entity array_push($target_ids, ...$ids_already_known['additional']); } - return DB::findBy('actor', ['id' => array_unique($target_ids)]); + $target_ids = array_unique($target_ids); + return $target_ids === [] ? [] : DB::findBy('actor', ['id' => $target_ids]); } public static function schemaDef(): array diff --git a/src/Entity/Note.php b/src/Entity/Note.php index 7fa85d9efd..9b24da8fc3 100644 --- a/src/Entity/Note.php +++ b/src/Entity/Note.php @@ -350,7 +350,7 @@ class Note extends Entity { $rendered = null; $mentions = []; - Event::handle('RenderNoteContent', [$this->getContent(), $this->getContentType(), &$rendered, &$mentions, $this->getActor(), Language::getById($this->getLanguageId())->getLocale()]); + Event::handle('RenderNoteContent', [$this->getContent(), $this->getContentType(), &$rendered, $this->getActor(), Language::getById($this->getLanguageId())->getLocale(), &$mentions]); $mentioned = []; foreach ($mentions as $mention) { foreach ($mention['mentioned'] as $m) {