Replace the proxify function

This commit is contained in:
Michael 2021-07-05 21:35:57 +00:00
parent db90e3bf25
commit 3deb384c54
2 changed files with 4 additions and 4 deletions

View 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);

View 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;