aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-01 12:30:03 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-01 12:30:03 -0700
commit41e755222544ee0733098db20cecad5ffe6319fb (patch)
tree41e94b9fcf0b1dbddef5c463fa5fd53d1287daee /include
parent6199af6a790016254b3af3cebd334902469f86ec (diff)
downloadvolse-hubzilla-41e755222544ee0733098db20cecad5ffe6319fb.tar.gz
volse-hubzilla-41e755222544ee0733098db20cecad5ffe6319fb.tar.bz2
volse-hubzilla-41e755222544ee0733098db20cecad5ffe6319fb.zip
open bbcode tag
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php11
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>';