]> git.mxchange.org Git - friendica.git/commitdiff
Issue 10506 - again. Improved check for pictured in body
authorMichael <heluecht@pirati.ca>
Sat, 17 Jul 2021 07:55:19 +0000 (07:55 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 17 Jul 2021 07:55:19 +0000 (07:55 +0000)
src/Model/Item.php
src/Model/Post/Media.php

index 86b9270fe9e899c55f7e6bf4cd2c129f1d515619..b258e86470032cdcb9663184eafae30ad9e80d2e 100644 (file)
@@ -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;
                        }
 
index c0f09b8b90caeada8fece8212a7c4e4a6ee6e3ee..801f192e9d93584fc10c49250d99317e2d6c833c 100644 (file)
@@ -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;
                        }