1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/17326] Use same regex in icon name validation in PHP

PHPBB-17326
This commit is contained in:
Marc Alexander
2025-02-15 20:24:07 +01:00
parent 67e2b32816
commit 1e76b0df0e
2 changed files with 13 additions and 1 deletions

View File

@@ -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-]+(?<!-)$/', $bbcode_font_icon))
{
trigger_error($user->lang['BBCODE_FONT_ICON_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}