API: Forum mentions are now working

This commit is contained in:
Michael 2022-03-02 06:59:07 +00:00
parent 1f1d3b2578
commit f853d58198
3 changed files with 98 additions and 75 deletions

View file

@ -78,11 +78,6 @@ class Update extends BaseApi
$body = Markdown::toBBCode($request['status']);
}
// Avoids potential double expansion of existing links
$body = BBCode::performWithEscapedTags($body, ['url'], function ($body) {
return BBCode::expandTags($body);
});
$item = [];
$item['uid'] = $uid;
$item['verb'] = Activity::POST;
@ -127,6 +122,8 @@ class Update extends BaseApi
$item['object-type'] = Activity\ObjectType::NOTE;
}
$item = DI::contentItem()->expandTags($item);
if (!empty($request['media_ids'])) {
$ids = explode(',', $request['media_ids']);
} elseif (!empty($_FILES['media'])) {