Sometimes people can delete the opening [quote] tag and leave the closing [/quote] hanging.
In order to address this, I added the following to bbcode-filter.inc around line 62
if($unclosed > 0)
for ($i = 0; $i < $unclosed; $i++)
$body .= '[/quote]';
else if ($unclosed < 0)
for ($i = $unclosed; $i < 0; $i++)
$body = '[quote]'.$body;
...
if($unclosed > 0)
for ($i = 0; $i < $unclosed; $i++)
$body .= '[/list]';
else if ($unclosed < 0)
for ($i = $unclosed; $i < 0; $i++)
$body = '[list]'.$body;
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | bbcode-fix-unopened-tags-276344-2-D6.patch | 1.45 KB | tristanolive |
Comments
Comment #1
naudefj commentedCan you please submit a patch?
Comment #2
tristanolive commentedI had to do this also (all these years later), so here's a patch. This patch also converts [quote/] tags into proper [/quote] tags, as those can also break the output of the page.
Comment #3
naudefj commented