diff --git a/include/bbcode.php b/include/bbcode.php index 6f7ef8973..e97a96f87 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -668,6 +668,17 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { "
" . $t_wrote . "
$2
", $Text); + + $endlessloop = 0; + while ((strpos($Text, "[/open]")!== false) and (strpos($Text, "[open=") !== false) and (++$endlessloop < 20)) { + $rnd = mt_rand(); + $Text = preg_replace("/\[open=(.*?)\](.*?)\[\/open\]/ism", + "
$1
$2
", + $Text); + } + + + // Declare the format for [quote] layout $QuoteLayout = '
$1
';