diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-27 18:00:41 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-27 18:00:41 +0000 |
commit | 8e297a038c6dfed7ca892d8799cfbdb010cc0911 (patch) | |
tree | 7dc47f0754260c458fc760497fb3fec975af19ab /phpBB/includes/message_parser.php | |
parent | 82b8a1d96fa93d0ab2e14a24939f790259ccdea8 (diff) | |
download | forums-8e297a038c6dfed7ca892d8799cfbdb010cc0911.tar forums-8e297a038c6dfed7ca892d8799cfbdb010cc0911.tar.gz forums-8e297a038c6dfed7ca892d8799cfbdb010cc0911.tar.bz2 forums-8e297a038c6dfed7ca892d8799cfbdb010cc0911.tar.xz forums-8e297a038c6dfed7ca892d8799cfbdb010cc0911.zip |
hopefully fixed bug #5644 while also retaining the fix for bug #3572
testing this is appreciated.
git-svn-id: file:///svn/phpbb/trunk@6673 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 39 |
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 = ''; } } |