aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-22 20:58:04 -0800
committerfriendica <info@friendica.com>2012-02-22 20:58:04 -0800
commit3c6b127d40e2f0ea1c2d8eb7114c3e121b58ba2e (patch)
tree2edc9ec641d5ac2a39ff48cbec877d42a469b0cf
parentd75d49a4c195e6cde5b369f802d10044c5aac257 (diff)
downloadvolse-hubzilla-3c6b127d40e2f0ea1c2d8eb7114c3e121b58ba2e.tar.gz
volse-hubzilla-3c6b127d40e2f0ea1c2d8eb7114c3e121b58ba2e.tar.bz2
volse-hubzilla-3c6b127d40e2f0ea1c2d8eb7114c3e121b58ba2e.zip
nested quote check fails to account for strpos returning position 0
-rwxr-xr-xinclude/bbcode.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index d639b0c39..32053b4ec 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",
"<blockquote><strong>" . $t_wrote . "</strong> $2</blockquote>",
$Text);