]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Media.php
Remove "fcontact" from suggestions
[friendica.git] / src / Model / Post / Media.php
index 087a36cb167aa50bab3c9817f6e8e7fc8e2630e1..b42ba89cf4957c66962d0ca9caa9afc6caa28a12 100644 (file)
@@ -388,6 +388,10 @@ class Media
                }
 
                foreach ($attachments as $attachment) {
+                       if (Post\Link::exists($uriid, $attachment['preview'] ?? $attachment['url'])) {
+                               continue;
+                       }
+
                        // Only store attachments that are part of the unshared body
                        if (Item::containsLink($unshared_body, $attachment['preview'] ?? $attachment['url'], $attachment['type'])) {
                                self::insert($attachment);
@@ -547,7 +551,6 @@ class Media
                        return $attachments;
                }
 
-               $height = 0;
                $heights = [];
                $selected = '';
                $previews = [];
@@ -683,7 +686,7 @@ class Media
         * Get preview link for given media id
         *
         * @param integer $id   media id
-        * @param string  $size One of the ProxyUtils::SIZE_* constants
+        * @param string  $size One of the Proxy::SIZE_* constants
         * @return string preview link
         */
        public static function getPreviewUrlForId(int $id, string $size = ''):string
@@ -713,7 +716,7 @@ class Media
         * Get media link for given media id
         *
         * @param integer $id   media id
-        * @param string  $size One of the ProxyUtils::SIZE_* constants
+        * @param string  $size One of the Proxy::SIZE_* constants
         * @return string media link
         */
        public static function getUrlForId(int $id, string $size = ''):string