"inform" functionality moved / unified functionality

This commit is contained in:
Michael 2022-01-30 10:56:13 +00:00
parent 0e5ee88c43
commit 8034a48ffe
3 changed files with 29 additions and 61 deletions

View file

@ -2358,11 +2358,10 @@ class BBCode
public static function setMentions($body, $profile_uid = 0, $network = '')
{
DI::profiler()->startRecording('rendering');
self::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network) {
$body = self::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network) {
$tags = self::getTags($body);
$tagged = [];
$inform = '';
foreach ($tags as $tag) {
$tag_type = substr($tag, 0, 1);
@ -2381,7 +2380,7 @@ class BBCode
}
}
if (($success = Item::replaceTag($body, $inform, $profile_uid, $tag, $network)) && $success['replaced']) {
if (($success = Item::replaceTag($body, $profile_uid, $tag, $network)) && $success['replaced']) {
$tagged[] = $tag;
}
}