From 7ea118198e3af9f6ff97c883a75b38bef2fc3881 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 15:29:38 +0000 Subject: [PATCH] - Fix quote bbcode parsing adding too much closing tags on special conditions - #20735 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8393 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/message_parser.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 36c52a23c8..677ace42fe 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -127,6 +127,7 @@
  • [Change] Use correct string for filesize (MiB instead of MB for example)
  • [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
  • [Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)
  • +
  • [Fix] Quote bbcode parsing adding too much closing tags on special conditions (Bug #20735)
  • 1.i. Changes since 3.0.RC8

    diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e78fc271a6..41e7bc51d7 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -684,7 +684,8 @@ class bbcode_firstpass extends bbcode * #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed) * #14770 - [quote="["]test[/quote] (correct: parsed) * [quote="[i]test[/i]"]test[/quote] (correct: parsed) - * [quote="[quote]test[/quote]"]test[/quote] (correct: NOT parsed) + * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote]) + * #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted) */ $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); @@ -737,7 +738,7 @@ class bbcode_firstpass extends bbcode $out .= ' '; }*/ } - else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m)) + else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m) && substr($out, -1, 1) == '[') { $this->parsed_items['quote']++;