diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-08 14:38:44 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-10-08 14:38:44 +0000 |
commit | e8b2c4128ec285314ce6c58d3989a9c92f8a456c (patch) | |
tree | cabeaee81eb0ebff31a48cd9f914e708a32221f3 /phpBB/includes/message_parser.php | |
parent | b3475ac8038240707faff9949e0fec423abbc627 (diff) | |
download | forums-e8b2c4128ec285314ce6c58d3989a9c92f8a456c.tar forums-e8b2c4128ec285314ce6c58d3989a9c92f8a456c.tar.gz forums-e8b2c4128ec285314ce6c58d3989a9c92f8a456c.tar.bz2 forums-e8b2c4128ec285314ce6c58d3989a9c92f8a456c.tar.xz forums-e8b2c4128ec285314ce6c58d3989a9c92f8a456c.zip |
some tiny bugfixes
git-svn-id: file:///svn/phpbb/trunk@8155 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index f80715f211..e9729445f2 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -672,6 +672,11 @@ class bbcode_firstpass extends bbcode { global $config, $user; + /** + * If you change this code, make sure the cases described within the following reports are still working: + * #3572, #14667 + */ + $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); if (!$in) @@ -801,12 +806,19 @@ class bbcode_firstpass extends bbcode { // Search the text for the next tok... if an ending quote comes first, then change tok to [] $pos1 = strpos($in, '[/quote'); + // If the token ] comes first, we change it to ] $pos2 = strpos($in, ']'); + // If the token [ comes first, we change it to [ + $pos3 = strpos($in, '['); - if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2)) + if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2) && ($pos3 === false || $pos1 < $pos3)) { $tok = '[]'; } + else if ($pos3 !== false && ($pos2 === false || $pos3 < $pos2)) + { + $tok = '['; + } else { $tok = ']'; @@ -1049,7 +1061,7 @@ class parse_message extends bbcode_firstpass $this->message = preg_replace($match, $replace, trim($this->message)); // Message length check. -1 disables this check completely. - if ($config['max_' . $mode . '_chars'] != -1) + if ($config['max_' . $mode . '_chars']) { $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)); |