From 3c6b127d40e2f0ea1c2d8eb7114c3e121b58ba2e Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 22 Feb 2012 20:58:04 -0800 Subject: [PATCH] nested quote check fails to account for strpos returning position 0 --- include/bbcode.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index d639b0c39a..32053b4ecd 100755 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -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); -- 2.39.5