]> git.mxchange.org Git - friendica.git/commitdiff
Fix missing links in posts
authorMichael <heluecht@pirati.ca>
Sun, 23 Jun 2024 13:22:15 +0000 (13:22 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 23 Jun 2024 13:22:15 +0000 (13:22 +0000)
src/Model/Post/Media.php

index 39fc08ce275dba86ffe497b5b8f4bf440b1134c8..7159591821fdf0beb70986fdca16092d06566b53 100644 (file)
@@ -88,8 +88,8 @@ class Media
                // "document" has got the lowest priority. So when the same file is both attached as document
                // and embedded as picture then we only store the picture or replace the document
                $found = DBA::selectFirst('post-media', ['type'], ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
-               if (!$force && !empty($found) && (($found['type'] != self::DOCUMENT) || ($media['type'] == self::DOCUMENT))) {
-                       Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
+               if (!$force && !empty($found) && (!in_array($found['type'], [self::UNKNOWN, self::DOCUMENT]) || ($media['type'] == self::DOCUMENT))) {
+                       Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'found' => $found['type'], 'new' => $media['type']]);
                        return false;
                }