Prevent expandTags to be performed on existing links in Module\Api\Mastodon\Statuses

- We never need to expand tags inside of an already existing BBCode url tag
This commit is contained in:
Hypolite Petovan 2021-09-12 00:05:22 -04:00
parent 8628bd5228
commit 5a93bb6eff

View file

@ -63,7 +63,10 @@ class Statuses extends BaseApi
// The imput is defined as text. So we can use Markdown for some enhancements
$body = Markdown::toBBCode($request['status']);
$body = BBCode::expandTags($body);
// Avoids potential double expansion of existing links
$body = BBCode::performWithEscapedTags($body, ['url'], function ($body) {
return BBCode::expandTags($body);
});
$item = [];
$item['uid'] = $uid;