]> git.mxchange.org Git - friendica.git/commitdiff
Add the attachments to the $item for the prepare_body_content_filter hook
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 16 Aug 2021 09:28:08 +0000 (05:28 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 16 Aug 2021 09:28:08 +0000 (05:28 -0400)
- Allows filtering on attachments that are added later to the post content

src/Model/Item.php
src/Model/Post/Media.php

index beb7db5764773a41f2909bead2446d8e644a5f1d..c683e10e78158383bb9ac51efc2040a680e88a7e 100644 (file)
@@ -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
index 801f192e9d93584fc10c49250d99317e2d6c833c..fae71a95363461412968f8b799776bcb755927c5 100644 (file)
@@ -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 = [])