]> git.mxchange.org Git - friendica.git/commitdiff
Fix: Fetch media in shared posts
authorMichael <heluecht@pirati.ca>
Tue, 17 May 2022 07:58:41 +0000 (07:58 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 17 May 2022 07:58:41 +0000 (07:58 +0000)
src/Model/Item.php

index c88b35a5d2ec625666bb96c3df2bc443cc013456..8b2a4651dc3dc7fa30575d1b3886dacb47d7afe2 100644 (file)
@@ -2786,10 +2786,10 @@ class Item
                $body = $item['body'] ?? '';
                $shared = BBCode::fetchShareAttributes($body);
                if (!empty($shared['guid'])) {
-                       $shared_item = Post::selectFirst(['uri-id', 'plink'], ['guid' => $shared['guid']]);
+                       $shared_item = Post::selectFirst(['uri-id', 'plink', 'has-media'], ['guid' => $shared['guid']]);
                        $shared_uri_id = $shared_item['uri-id'] ?? 0;
                        $shared_links = [strtolower($shared_item['plink'] ?? '')];
-                       $shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared['guid'], [], $item['has-media']);
+                       $shared_attachments = Post\Media::splitAttachments($shared_uri_id, $shared['guid'], [], $shared_item['has-media']);
                        $shared_links = array_merge($shared_links, array_column($shared_attachments['visual'], 'url'));
                        $shared_links = array_merge($shared_links, array_column($shared_attachments['link'], 'url'));
                        $shared_links = array_merge($shared_links, array_column($shared_attachments['additional'], 'url'));