hopefully fixed bug #5644 while also retaining the fix for bug #3572

testing this is appreciated.


git-svn-id: file:///svn/phpbb/trunk@6673 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-11-27 18:00:41 +00:00
parent 82b8a1d96f
commit 8e297a038c

View file

@ -664,14 +664,7 @@ class bbcode_firstpass extends bbcode
else else
{ {
$end_tag = array_pop($end_tags); $end_tag = array_pop($end_tags);
if ($end_tag != $tag) $error = ($end_tag != $tag) ? true : false;
{
$error = true;
}
else
{
$error = false;
}
} }
} }
@ -704,9 +697,35 @@ class bbcode_firstpass extends bbcode
} }
else else
{ {
/**
* Old quote code working fine, but having errors listed in bug #3572
*
* $out .= $buffer . $tok;
* $tok = ($tok == '[') ? ']' : '[]';
* $buffer = '';
*/
$out .= $buffer . $tok; $out .= $buffer . $tok;
// $tok = ($tok == '[') ? ']' : '[]';
$tok = '[]'; if ($tok == '[')
{
// Search the text for the next tok... if an ending quote comes first, then change tok to []
$pos1 = strpos($in, '[/quote');
$pos2 = strpos($in, ']');
if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2))
{
$tok = '[]';
}
else
{
$tok = ']';
}
}
else
{
$tok = '[]';
}
$buffer = ''; $buffer = '';
} }
} }