Matching not only unclosed [quote] and [list] tags but also unopened [/quote] and [/list]

mjourney2 - June 29, 2008 - 14:05
Project:Bbcode
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:naudefj
Status:postponed
Description

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;

#1

naudefj - November 30, 2008 - 09:26
Assigned to:Anonymous» naudefj
Status:active» postponed

Can you please submit a patch?

 
 

Drupal is a registered trademark of Dries Buytaert.