diff options
author | rxu <rxu@mail.ru> | 2011-04-17 17:58:11 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2011-06-06 00:53:11 +0800 |
commit | 16ab0d8c264d88db5e3e961e66e6820b365f45ac (patch) | |
tree | 8ddd1e899bb445181705c702492db63164ac0112 | |
parent | 116744d4e5ba95645162c77124854cc58e1d6084 (diff) | |
download | forums-16ab0d8c264d88db5e3e961e66e6820b365f45ac.tar forums-16ab0d8c264d88db5e3e961e66e6820b365f45ac.tar.gz forums-16ab0d8c264d88db5e3e961e66e6820b365f45ac.tar.bz2 forums-16ab0d8c264d88db5e3e961e66e6820b365f45ac.tar.xz forums-16ab0d8c264d88db5e3e961e66e6820b365f45ac.zip |
[ticket/217] Multiline [url] not converted
This is the second attempt parse multiline URL text, see the ticket comments.
PHPBB3-217
-rw-r--r-- | phpBB/includes/message_parser.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6951dcf820..8f5e72cbf7 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -109,13 +109,15 @@ class bbcode_firstpass extends bbcode // This array holds all bbcode data. BBCodes will be processed in this // order, so it is important to keep [code] in first position and // [quote] in second position. + // To parse multiline URL we enable dotall option setting only for URL text + // but not for link itself, thus [url][/url] is not affected. $this->bbcodes = array( 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")), 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:="(.*?)")?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")), 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uise' => "\$this->bbcode_attachment('\$1', '\$2')")), 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->bbcode_strong('\$1')")), 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uise' => "\$this->bbcode_italic('\$1')")), - 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#uiUe' => "\$this->validate_url('\$2', '\$3')")), + 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiUe' => "\$this->validate_url('\$2', '\$3')")), 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiUe' => "\$this->bbcode_img('\$1')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uise' => "\$this->bbcode_color('\$1', '\$2')")), |