diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index ee3dffd461..723a13d1db 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -241,7 +241,7 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_FONT_ICON_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); } - if (!empty($bbcode_font_icon) && !preg_match('/^[\w-]+$/', $bbcode_font_icon)) + if (!empty($bbcode_font_icon) && !preg_match('/^(?!-)(?!.*--)[a-z0-9-]+(?lang['BBCODE_FONT_ICON_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } diff --git a/tests/functional/acp_bbcodes_test.php b/tests/functional/acp_bbcodes_test.php index ac73091a79..dd0d356a58 100644 --- a/tests/functional/acp_bbcodes_test.php +++ b/tests/functional/acp_bbcodes_test.php @@ -98,6 +98,18 @@ class phpbb_functional_acp_bbcodes_test extends phpbb_functional_test_case 'Not a valid icon name', 'is invalid', ], + 'icon name invalid double dash' => [ + '[mod2="{TEXT1}"]{TEXT2}[/mod2]', + '