mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
nested quote check fails to account for strpos returning position 0
This commit is contained in:
parent
d75d49a4c1
commit
3c6b127d40
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue