aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php39
1 files changed, 29 insertions, 10 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index f0982ca12b..c2c700e1c5 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -664,14 +664,7 @@ class bbcode_firstpass extends bbcode
else
{
$end_tag = array_pop($end_tags);
- if ($end_tag != $tag)
- {
- $error = true;
- }
- else
- {
- $error = false;
- }
+ $error = ($end_tag != $tag) ? true : false;
}
}
@@ -704,9 +697,35 @@ class bbcode_firstpass extends bbcode
}
else
{
+/**
+* Old quote code working fine, but having errors listed in bug #3572
+*
+* $out .= $buffer . $tok;
+* $tok = ($tok == '[') ? ']' : '[]';
+* $buffer = '';
+*/
+
$out .= $buffer . $tok;
- // $tok = ($tok == '[') ? ']' : '[]';
- $tok = '[]';
+
+ if ($tok == '[')
+ {
+ // Search the text for the next tok... if an ending quote comes first, then change tok to []
+ $pos1 = strpos($in, '[/quote');
+ $pos2 = strpos($in, ']');
+
+ if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2))
+ {
+ $tok = '[]';
+ }
+ else
+ {
+ $tok = ']';
+ }
+ }
+ else
+ {
+ $tok = '[]';
+ }
$buffer = '';
}
}