From 10cdefa232777255d34856c5d70463995763def7 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 17 May 2022 07:58:41 +0000 Subject: [PATCH] Fix: Fetch media in shared posts --- src/Model/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index c88b35a5d2..8b2a4651dc 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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')); -- 2.39.5