diff options
author | David M <davidmj@users.sourceforge.net> | 2006-12-24 14:28:01 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-12-24 14:28:01 +0000 |
commit | f0129b6f27cc05f9e6488729acd32739e2616602 (patch) | |
tree | 08dce0ed45a6b7b2b57aca92075175db18e43415 /phpBB/includes/message_parser.php | |
parent | ae1cb0316e6c19d62f0579e9cef52f11df081bcf (diff) | |
download | forums-f0129b6f27cc05f9e6488729acd32739e2616602.tar forums-f0129b6f27cc05f9e6488729acd32739e2616602.tar.gz forums-f0129b6f27cc05f9e6488729acd32739e2616602.tar.bz2 forums-f0129b6f27cc05f9e6488729acd32739e2616602.tar.xz forums-f0129b6f27cc05f9e6488729acd32739e2616602.zip |
#6542
git-svn-id: file:///svn/phpbb/trunk@6804 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index c139af5ef7..69b085e516 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -84,15 +84,12 @@ class bbcode_firstpass extends bbcode function prepare_bbcodes() { // Add newline at the end and in front of each quote block to prevent parsing errors (urls, smilies, etc.) - if (strpos($this->message, '[quote') !== false) + if (strpos($this->message, '[quote') !== false && strpos($this->message, '[/quote]') !== false) { $this->message = str_replace("\r\n", "\n", $this->message); - // We strip newlines and spaces after and before quotes in quotes (trimming) - $this->message = preg_replace(array('#\[quote(=".*?")?\]([\s|\n]+)#ius', '#([\s|\n]+)\[\/quote\]#ius'), array("[quote\\1]", "[/quote]"), $this->message); - - // Now we add exactly one newline - $this->message = preg_replace(array('#\[quote(=".*?")?\]#is', '#\[\/quote\]#is'), array("[quote\\1]\n", "\n[/quote]"), $this->message); + // We strip newlines and spaces after and before quotes in quotes (trimming) and then add exactly one newline + $this->message = preg_replace('#\[quote(=".*?")?\]\s*(.*?)\s*\[/quote\]#siu', '[quote\1]' . "\n" . '\2' ."\n[/quote]", $this->message); } // Add other checks which needs to be placed before actually parsing anything (be it bbcodes, smilies, urls...) |