aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-05-18 21:43:25 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-05-18 21:43:25 +0200
commit1494c54803b3043ded965e9040bbd9116e4b6a53 (patch)
tree1dd8ee4a6e8ef1118bd0198ad75270b953a2531a /phpBB/includes/message_parser.php
parent2911c0168331a8f23dd8836d092d5e3fe6cac070 (diff)
downloadforums-1494c54803b3043ded965e9040bbd9116e4b6a53.tar
forums-1494c54803b3043ded965e9040bbd9116e4b6a53.tar.gz
forums-1494c54803b3043ded965e9040bbd9116e4b6a53.tar.bz2
forums-1494c54803b3043ded965e9040bbd9116e4b6a53.tar.xz
forums-1494c54803b3043ded965e9040bbd9116e4b6a53.zip
[ticket/13832] Do not use e modifier for bbcodes in message_parser
PHPBB3-13832
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index e4a89b62ca..06c3c2c9c2 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -138,19 +138,19 @@ class bbcode_firstpass extends bbcode
// 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(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")),
- 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uise' => "\$this->bbcode_attachment('\$1', '\$2')")),
+ 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_code($match[1], $match[2]); })),
+ 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_quote($match[0]); })),
+ 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_attachment($match[1], $match[2]); })),
'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_strong($match[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') ? '\$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')")),
- 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uise' => "\$this->bbcode_underline('\$1')")),
- 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uise' => "\$this->bbcode_parse_list('\$0')")),
- 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uise' => "\$this->validate_email('\$1', '\$2')")),
- 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#uie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
+ 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_italic($match[1]); })),
+ 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) { global $bbcode_class; return $bbcode_class->validate_url($match[2], ($match[3]) ? $match[3] : $match[4]); })),
+ 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiU' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_img($match[1]); })),
+ 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_size($match[1], $match[2]); })),
+ 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_color($match[1], $match[2]); })),
+ 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_underline($match[1]); })),
+ 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_parse_list($match[0]); })),
+ 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) { global $bbcode_class; return $bbcode_class->validate_email($match[1], $match[2]); })),
+ 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) { global $bbcode_class; return $bbcode_class->bbcode_flash($match[1], $match[2], $match[3]); }))
);
// Zero the parsed items array