Unifiy the creation of photo links

This commit is contained in:
Michael 2023-05-09 20:44:58 +00:00
parent 4c40bc164d
commit 7d91cc73de
5 changed files with 34 additions and 14 deletions

View file

@ -180,7 +180,7 @@ class Upload extends \Friendica\BaseModule
}
$this->logger->info('upload done');
$this->return(200, "\n\n" . '[url=' . $this->baseUrl . '/photos/' . $owner['nickname'] . '/image/' . $resource_id . '][img=' . $this->baseUrl . "/photo/$resource_id-$preview." . $image->getExt() . "][/img][/url]\n\n");
$this->return(200, "\n\n" . Images::getImageUrl($resource_id, $owner['nickname'], $preview, $image->getExt(), '') . "\n\n");
}
/**

View file

@ -273,9 +273,7 @@ class Photos extends \Friendica\Module\BaseProfile
$arr['visible'] = $visible;
$arr['origin'] = 1;
$arr['body'] = '[url=' . $this->baseUrl . '/photos/' . $this->owner['nickname'] . '/image/' . $resource_id . ']'
. '[img]' . $this->baseUrl . "/photo/{$resource_id}-{$preview}.".$image->getExt() . '[/img]'
. '[/url]';
$arr['body'] = Images::getImageUrl($resource_id, $this->owner['nickname'], $preview, $image->getExt(), '');
$item_id = Item::insert($arr);
// Update the photo albums cache