]> git.mxchange.org Git - friendica.git/commitdiff
Replace the proxify function
authorMichael <heluecht@pirati.ca>
Mon, 5 Jul 2021 21:35:57 +0000 (21:35 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 5 Jul 2021 21:35:57 +0000 (21:35 +0000)
src/Protocol/Feed.php
src/Protocol/OStatus.php

index 5738c01d8a18ac4649c501ed2e9dee8260dc963f..f137bd2349dda50fefd313b31ef23cc1f83c88e8 100644 (file)
@@ -1107,7 +1107,7 @@ class Feed
                XML::addElement($doc, $entry, "id", $item["uri"]);
                XML::addElement($doc, $entry, "title", html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
 
-               $body = OStatus::formatPicturePost($item['body']);
+               $body = OStatus::formatPicturePost($item['body'], $item['uri-id']);
 
                $body = BBCode::convert($body, false, BBCode::OSTATUS);
 
index 1019d34cc79f6eb5d84880007099cddfb5728036..869213ade2d2b68cbc96b20742e1fc14ad26c783 100644 (file)
@@ -1195,7 +1195,7 @@ class OStatus
         * @return string The cleaned body
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function formatPicturePost($body)
+       public static function formatPicturePost($body, $uriid)
        {
                $siteinfo = BBCode::getAttachedData($body);
 
@@ -1207,7 +1207,7 @@ class OStatus
                        }
 
                        // Is it a remote picture? Then make a smaller preview here
-                       $preview = ProxyUtils::proxifyUrl($preview, ProxyUtils::SIZE_SMALL);
+                       $preview = Post\Link::getByLink($uriid, $preview, ProxyUtils::SIZE_SMALL);
 
                        // Is it a local picture? Then make it smaller here
                        $preview = str_replace(["-0.jpg", "-0.png"], ["-2.jpg", "-2.png"], $preview);
@@ -1886,7 +1886,7 @@ class OStatus
                XML::addElement($doc, $entry, "title", html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
 
                $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']);
-               $body = self::formatPicturePost($body);
+               $body = self::formatPicturePost($body, $item['uri-id']);
 
                if (!empty($item['title'])) {
                        $body = "[b]".$item['title']."[/b]\n\n".$body;