From: Hypolite Petovan Date: Mon, 16 Aug 2021 09:28:08 +0000 (-0400) Subject: Add the attachments to the $item for the prepare_body_content_filter hook X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7082582655a97a2c746bc740fe7184565c721707;p=friendica.git Add the attachments to the $item for the prepare_body_content_filter hook - Allows filtering on attachments that are added later to the post content --- diff --git a/src/Model/Item.php b/src/Model/Item.php index beb7db5764..c683e10e78 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2757,6 +2757,8 @@ class Item $filter_reasons[] = DI::l10n()->t('Content warning: %s', $item['content-warning']); } + $item['attachments'] = $attachments; + $hook_data = [ 'item' => $item, 'filter_reasons' => $filter_reasons diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 801f192e9d..fae71a9536 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -534,7 +534,7 @@ class Media * * @param int $uri_id * @param string $guid - * @param array $links ist of links that shouldn't be added + * @param array $links list of links that shouldn't be added * @return array attachments */ public static function splitAttachments(int $uri_id, string $guid = '', array $links = [])