From: Michael Date: Tue, 18 Apr 2023 17:56:30 +0000 (+0000) Subject: Fix: Only add link preview for selected networks X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2ad8bd901a15c0a8720b81e217429e7ab39547a2;p=friendica.git Fix: Only add link preview for selected networks --- diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index e80cc131f6..77ecf75214 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -635,7 +635,7 @@ class Media foreach ($matches[1] as $url) { Logger::info('Got page url (link without description)', ['uri-id' => $uriid, 'url' => $url]); $result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false, $network); - if ($result && ($network == Protocol::DFRN)) { + if ($result && !in_array($network, [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA])) { self::revertHTMLType($uriid, $url, $fullbody); Logger::debug('Revert HTML type', ['uri-id' => $uriid, 'url' => $url]); } elseif ($result) { @@ -651,7 +651,7 @@ class Media foreach ($matches[1] as $url) { Logger::info('Got page url (link with description)', ['uri-id' => $uriid, 'url' => $url]); $result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false, $network); - if ($result && ($network == Protocol::DFRN)) { + if ($result && !in_array($network, [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA])) { self::revertHTMLType($uriid, $url, $fullbody); Logger::debug('Revert HTML type', ['uri-id' => $uriid, 'url' => $url]); } elseif ($result) {