diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 82c6ed778b..236043f339 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -133,6 +133,11 @@ class acp_bbcodes
}
}
+ if (strlen($data['first_pass_match']) >= 255 || strlen($data['first_pass_replace']) >= 255 || strlen($data['second_pass_match']) >= 255)
+ {
+ trigger_error('BBCODE_TAG_TOO_LONG');
+ }
+
$sql_ary = array(
'bbcode_tag' => $data['bbcode_tag'],
'bbcode_match' => $bbcode_match,
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index 0b769c7743..e1941b7f8d 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -42,6 +42,7 @@ $lang = array_merge($lang, array(
'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouseover text of the BBCode',
'BBCODE_HELPLINE_TEXT' => 'Helpline text',
'BBCODE_TAG' => 'Tag',
+ 'BBCODE_TAG_TOO_LONG' => 'The tag definition that you have entered is too long, please shorten your tag definition.',
'BBCODE_USAGE' => 'BBCode usage',
'BBCODE_USAGE_EXAMPLE' => '[colour={COLOR}]{TEXT}[/colour]
[font={TEXT1}]{TEXT2}[/font]',
'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the bbcode. Replace any variable input by the corresponding token (%ssee below%s)',