diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-19 13:10:13 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-19 13:10:13 +0000 |
commit | bc0898f55e2c0bda196fa44cc7d1bb15b6fda649 (patch) | |
tree | 47192341eaa0ae65e53478ea32d9e0047a523579 /phpBB/includes/message_parser.php | |
parent | 8963b032de7c14151d9432ca208038c4f515d961 (diff) | |
download | forums-bc0898f55e2c0bda196fa44cc7d1bb15b6fda649.tar forums-bc0898f55e2c0bda196fa44cc7d1bb15b6fda649.tar.gz forums-bc0898f55e2c0bda196fa44cc7d1bb15b6fda649.tar.bz2 forums-bc0898f55e2c0bda196fa44cc7d1bb15b6fda649.tar.xz forums-bc0898f55e2c0bda196fa44cc7d1bb15b6fda649.zip |
fixing some annoying bugs
git-svn-id: file:///svn/phpbb/trunk@8204 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 311c75b410..f7ae685e95 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -674,7 +674,11 @@ class bbcode_firstpass extends bbcode /** * If you change this code, make sure the cases described within the following reports are still working: - * #3572, #14667 + * #3572 - [quote="[test]test"]test [ test[/quote] - (correct: parsed) + * #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) */ $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); @@ -684,6 +688,9 @@ class bbcode_firstpass extends bbcode return ''; } + // To let the parser not catch tokens within quote_username quotes we encode them before we start this... + $in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']'), array('[', ']'), '\$1') . '"]'", $in); + $tok = ']'; $out = '['; @@ -745,7 +752,9 @@ class bbcode_firstpass extends bbcode if (isset($m[1]) && $m[1]) { - $username = preg_replace('#\[(?!b|i|u|color|url|email|/b|/i|/u|/color|/url|/email)#iU', '[$1', $m[1]); + $username = str_replace(array('[', ']'), array('[', ']'), $m[1]); + $username = preg_replace('#\[(?!b|i|u|color|url|email|/b|/i|/u|/color|/url|/email)#iU', '[$1', $username); + $end_tags = array(); $error = false; @@ -765,7 +774,7 @@ class bbcode_firstpass extends bbcode if ($error) { - $username = str_replace('[', '[', str_replace(']', ']', $m[1])); + $username = $m[1]; } $out .= 'quote="' . $username . '":' . $this->bbcode_uid . ']'; @@ -1073,7 +1082,7 @@ class parse_message extends bbcode_firstpass } // Check for "empty" message - if (!utf8_clean_string($this->message)) + if ($mode !== 'sig' && !utf8_clean_string($this->message)) { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return $this->warn_msg; |