Merge pull request #8783 from MrPetovan/bug/8488-exclude-img-tags

Exclude [img] tags from tag replacement
This commit is contained in:
Michael Vogel 2020-06-17 08:20:50 +02:00 committed by GitHub
commit df03b19a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -375,7 +375,7 @@ function item_post(App $a) {
$only_to_forum = false;
$forum_contact = [];
$body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code'], function ($body) use ($profile_uid, $network, $str_contact_allow, &$inform, &$private_forum, &$private_id, &$only_to_forum, &$forum_contact) {
$body = BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network, $str_contact_allow, &$inform, &$private_forum, &$private_id, &$only_to_forum, &$forum_contact) {
$tags = BBCode::getTags($body);
$tagged = [];

View File

@ -2188,7 +2188,7 @@ class BBCode
*/
public static function setMentions($body, $profile_uid = 0, $network = '')
{
BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code'], function ($body) use ($profile_uid, $network) {
BBCode::performWithEscapedTags($body, ['noparse', 'pre', 'code', 'img'], function ($body) use ($profile_uid, $network) {
$tags = BBCode::getTags($body);
$tagged = [];
@ -2211,7 +2211,7 @@ class BBCode
}
}
$success = Item::replaceTag($body, $inform, $profile_uid, $tag, $network);
$success = Item::replaceTag($body, $inform, $profile_uid, $tag, $network);
if ($success['replaced']) {
$tagged[] = $tag;