diff options
-rw-r--r-- | include/bbcode.php | 11 |
1 files changed, 11 insertions, 0 deletions
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) { "<br /><strong class=".'"spoiler"'.">" . $t_wrote . "</strong><blockquote class=".'"spoiler"'.">$2</blockquote>", $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", + "<br /><div onclick=\"openClose('opendiv-" . $rnd . "');return false;\" class=\"fakelink\">$1</div><div id=\"opendiv-" . $rnd . "\" style=\"display: none;\">$2</div>", + $Text); + } + + + // Declare the format for [quote] layout $QuoteLayout = '<blockquote>$1</blockquote>'; |