Exclude [img] tags from tag replacement

- It broke image captions by inserting an HTML link inside an HTML attribute
This commit is contained in:
Hypolite Petovan 2020-06-16 16:34:16 -04:00
parent 84c56c481a
commit f9ecbbd743
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 = [];