// @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;
}
$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;
}