diff --git a/src/Model/Item.php b/src/Model/Item.php index 86b9270fe..b258e8647 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2883,7 +2883,7 @@ class Item // @todo In the future we should make a single for the template engine with all media in it. This allows more flexibilty. foreach ($attachments['visual'] as $attachment) { - if (self::containsLink($item['body'], $attachment['url'], $attachment['type'])) { + if (self::containsLink($item['body'], $attachment['preview'] ?? $attachment['url'], $attachment['type'])) { continue; } diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index c0f09b8b9..801f192e9 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -637,7 +637,7 @@ class Media $body = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", '', $body); foreach (self::getByURIId($uriid, [self::IMAGE, self::AUDIO, self::VIDEO]) as $media) { - if (Item::containsLink($body, $media['url'], $media['type'])) { + if (Item::containsLink($body, $media['preview'] ?? $media['url'], $media['type'])) { continue; }