aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorJakub Senko <jakubsenko@gmail.com>2016-03-18 10:56:14 +0100
committerJakub Senko <jakubsenko@gmail.com>2016-03-18 10:56:14 +0100
commit46c79bbe901d31e93d321a8de46696d3ac277cd5 (patch)
tree9e8e76021ad31be8e53fa1aa3883657a378d0f36 /phpBB/includes/message_parser.php
parenteca4726f3c2fda312b3150b7b252a300d4603fbe (diff)
downloadforums-46c79bbe901d31e93d321a8de46696d3ac277cd5.tar
forums-46c79bbe901d31e93d321a8de46696d3ac277cd5.tar.gz
forums-46c79bbe901d31e93d321a8de46696d3ac277cd5.tar.bz2
forums-46c79bbe901d31e93d321a8de46696d3ac277cd5.tar.xz
forums-46c79bbe901d31e93d321a8de46696d3ac277cd5.zip
[ticket/9435] Convert bbcode magic numbers to constants
PHPBB3-9435
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 97e0dd9f0d..ad277fd90a 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -141,67 +141,67 @@ class bbcode_firstpass extends bbcode
// To perform custom validation in extension, use $this->validate_bbcode_by_extension()
// method which accepts variable number of parameters
$this->bbcodes = array(
- 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) use($bbcode_class)
+ 'code' => array('bbcode_id' => BBCODE_CODE_ID, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) use($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) use($bbcode_class)
+ 'quote' => array('bbcode_id' => BBCODE_QUOTE_ID, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_quote($match[0]);
}
)),
- 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) use($bbcode_class)
+ 'attachment' => array('bbcode_id' => BBCODE_ATTACH_ID, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_attachment($match[1], $match[2]);
}
)),
- 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) use($bbcode_class)
+ 'b' => array('bbcode_id' => BBCODE_B_ID, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_strong($match[1]);
}
)),
- 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) use($bbcode_class)
+ 'i' => array('bbcode_id' => BBCODE_I_ID, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_italic($match[1]);
}
)),
- 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) use($bbcode_class)
+ 'url' => array('bbcode_id' => BBCODE_URL_ID, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) use($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) use($bbcode_class)
+ 'img' => array('bbcode_id' => BBCODE_IMG_ID, 'regexp' => array('#\[img\](.*)\[/img\]#uiU' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_img($match[1]);
}
)),
- 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) use($bbcode_class)
+ 'size' => array('bbcode_id' => BBCODE_SIZE_ID, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) use($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) use($bbcode_class)
+ 'color' => array('bbcode_id' => BBCODE_COLOR_ID, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_color($match[1], $match[2]);
}
)),
- 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) use($bbcode_class)
+ 'u' => array('bbcode_id' => BBCODE_U_ID, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) use($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) use($bbcode_class)
+ 'list' => array('bbcode_id' => BBCODE_LIST_ID, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_parse_list($match[0]);
}
)),
- 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) use($bbcode_class)
+ 'email' => array('bbcode_id' => BBCODE_EMAIL_ID, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) use($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) use($bbcode_class)
+ 'flash' => array('bbcode_id' => BBCODE_FLASH_ID, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_flash($match[1], $match[2], $match[3]);
}