diff options
author | rxu <rxu@mail.ru> | 2011-06-05 21:55:28 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2011-06-06 00:53:53 +0800 |
commit | 6585d938d2c441900d8af6d25da2433d3beec856 (patch) | |
tree | 25e61be2c303c0ad97b08a936a48128a7fc4b848 /phpBB/includes/message_parser.php | |
parent | 16ab0d8c264d88db5e3e961e66e6820b365f45ac (diff) | |
download | forums-6585d938d2c441900d8af6d25da2433d3beec856.tar forums-6585d938d2c441900d8af6d25da2433d3beec856.tar.gz forums-6585d938d2c441900d8af6d25da2433d3beec856.tar.bz2 forums-6585d938d2c441900d8af6d25da2433d3beec856.tar.xz forums-6585d938d2c441900d8af6d25da2433d3beec856.zip |
[ticket/217] Adjust patch, add tests
PHPBB3-217
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 8f5e72cbf7..a6a4e530f0 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -102,7 +102,7 @@ class bbcode_firstpass extends bbcode /** * Init bbcode data for later parsing */ - function bbcode_init() + function bbcode_init($no_custom_bbcode = false) { static $rowset; @@ -117,7 +117,7 @@ class bbcode_firstpass extends bbcode '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(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/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') ? '\$3' : '\$4')")), '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')")), @@ -135,6 +135,11 @@ class bbcode_firstpass extends bbcode $this->parsed_items[$tag] = 0; } + if ($no_custom_bbcode) + { + return; + } + if (!is_array($rowset)) { global $db; @@ -970,7 +975,7 @@ class bbcode_firstpass extends bbcode } // Is this a link to somewhere inside this board? If so then remove the session id from the url - if (strpos($url, generate_board_url()) !== false && strpos($url, 'sid=') !== false) + if (strpos($url, @generate_board_url()) !== false && strpos($url, 'sid=') !== false) { $url = preg_replace('/(&|\?)sid=[0-9a-f]{32}&/', '\1', $url); $url = preg_replace('/(&|\?)sid=[0-9a-f]{32}$/', '', $url); |