From 311e35731c52102cbce3befc6343f179080ad38c Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 23 Feb 2012 20:51:44 +0100 Subject: bbcode.php: A list or quote at the beginning wasn't detected --- include/bbcode.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index d639b0c39..eef1cde1f 100755 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -151,7 +151,7 @@ function bbcode($Text,$preserve_nl = false) { // handle nested lists $endlessloop = 0; - while (strpos($Text, "[/list]") and strpos($Text, "[list") and (++$endlessloop < 20)) { + while ((strpos($Text, "[/list]") !== false) and (strpos($Text, "[list") !== false) and (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '' ,$Text); $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '' ,$Text); @@ -194,7 +194,7 @@ function bbcode($Text,$preserve_nl = false) { // Check for [quote] text // handle nested quotes $endlessloop = 0; - while (strpos($Text, "[/quote]") and strpos($Text, "[quote]") and (++$endlessloop < 20)) + while ((strpos($Text, "[/quote]") !== false) and (strpos($Text, "[quote]") !== false) and (++$endlessloop < 20)) $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text); // Check for [quote=Author] text @@ -203,7 +203,7 @@ function bbcode($Text,$preserve_nl = false) { // handle nested quotes $endlessloop = 0; - while (strpos($Text, "[/quote]") and strpos($Text, "[quote=") and (++$endlessloop < 20)) + while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", "
" . $t_wrote . " $2
", $Text); -- cgit v1.2.3 From 484a442f2b1072fe714174f4f782aa7d15818e72 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 23 Feb 2012 20:59:34 +0100 Subject: GIT problems ... --- include/bbcode.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) mode change 100755 => 100644 include/bbcode.php (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php old mode 100755 new mode 100644 index 47822d093..cff26f5c8 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -194,11 +194,7 @@ function bbcode($Text,$preserve_nl = false) { // Check for [quote] text // handle nested quotes $endlessloop = 0; -<<<<<<< HEAD while ((strpos($Text, "[/quote]") !== false) and (strpos($Text, "[quote]") !== false) and (++$endlessloop < 20)) -======= - while (strpos($Text, "[/quote]") !== false and strpos($Text, "[quote]") !== false and (++$endlessloop < 20)) ->>>>>>> upstream/master $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/ism","$QuoteLayout", $Text); // Check for [quote=Author] text @@ -207,11 +203,7 @@ function bbcode($Text,$preserve_nl = false) { // handle nested quotes $endlessloop = 0; -<<<<<<< HEAD while ((strpos($Text, "[/quote]")!== false) and (strpos($Text, "[quote=") !== false) and (++$endlessloop < 20)) -======= - while (strpos($Text, "[/quote]") !== false and strpos($Text, "[quote=") !== false and (++$endlessloop < 20)) ->>>>>>> upstream/master $Text = preg_replace("/\[quote=[\"\']*(.*?)[\"\']*\](.*?)\[\/quote\]/ism", "
" . $t_wrote . " $2
", $Text); @@ -293,3 +285,4 @@ function bbcode($Text,$preserve_nl = false) { return $Text; } + -- cgit v1.2.3