From 041aeaf4a159e277b828d8a386c0968657afb723 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Thu, 5 Jul 2012 12:52:20 -0600 Subject: fix small bug in lists and revert Diaspora list processing to non-Markdownify version --- include/bbcode.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index cb4a0bc6f..55a879497 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -166,14 +166,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // Check for list text $Text = str_replace("[*]", "
  • ", $Text); - $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '
  • $1
  • ' ,$Text); // 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)) { + ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false)) || + ((strpos($Text, "[/li]") !== false) && (strpos($Text, "[li]") !== false))) && (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '' ,$Text); @@ -183,6 +183,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '' ,$Text); $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '' ,$Text); + $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '
  • $1
  • ' ,$Text); } $Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '$1' ,$Text); -- cgit v1.2.3