Plasma Thu Jul 21 2022 at 5:28 am <img> is 5 characters
So you need to use something like this:
elseif ((strtolower(substr($text, $offset, 5)) == '<img>') && (TAG_IMG_ENABLED))
{
$text = substr_replace($text, '<img src="', $offset, 5);
$offset += 9;
}
elseif ((strtolower(substr($text, $offset, 6)) == '</img>') && (TAG_IMG_ENABLED))
{
$text = substr_replace($text, '">', $offset, 6);
$offset++;
}
You will need additional changes to prevent the forum from replacing the image URL with a link (similar to $in_code). Also would be good to check for things like recursive img tags.
- Need help on FlatForum. - Etrix (Tue Mar 7 2017 at 4:12 am)
- well - Plasma (Tue Mar 7 2017 at 8:34 pm)
- I see - Etrix (Thu Mar 9 2017 at 2:58 am)
- DERP - Darkhog (Sun Feb 4 2018 at 5:05 pm)
- Re: DERP - darel (Tue Jul 12 2022 at 11:09 pm)
|