aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorZach Prezkuta <fermion@gmx.com>2012-06-27 21:21:26 -0600
committerZach Prezkuta <fermion@gmx.com>2012-06-27 21:21:26 -0600
commitcd9ce0ecb3162a9d1a24cf1a1398891aa035becb (patch)
tree1dbd867dc2f8aaf2736c087a080e11eaf704ac64 /include/bbcode.php
parent3968e71d4c24a0dfd37a14545dc159c5f83155c6 (diff)
downloadvolse-hubzilla-cd9ce0ecb3162a9d1a24cf1a1398891aa035becb.tar.gz
volse-hubzilla-cd9ce0ecb3162a9d1a24cf1a1398891aa035becb.tar.bz2
volse-hubzilla-cd9ce0ecb3162a9d1a24cf1a1398891aa035becb.zip
fix logic for nested lists--should be OR, not AND
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index ee31b4a1a..9071c767b 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -163,9 +163,9 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
// handle nested lists
$endlessloop = 0;
- while ((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false) &&
- (strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false) &&
- (strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false) && (++$endlessloop < 20)) {
+ while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) ||
+ ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) ||
+ ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) {
$Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '<ul class="listnone" style="list-style-type: none;">$1</ul>' ,$Text);
$Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text);