mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-11 04:06:31 +02:00
[ticket/11538] Fix incorrect regex and test for duplicate # in color string
PHPBB3-11538
This commit is contained in:
@ -597,7 +597,7 @@ class ucp_groups
|
|||||||
|
|
||||||
if (!empty($submit_ary['colour']))
|
if (!empty($submit_ary['colour']))
|
||||||
{
|
{
|
||||||
preg_match('/^(#?)+(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/', $submit_ary['colour'], $group_colour);
|
preg_match('/^#?(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/', $submit_ary['colour'], $group_colour);
|
||||||
|
|
||||||
if (sizeof($group_colour))
|
if (sizeof($group_colour))
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,7 @@ class phpbb_functional_ucp_groups_test extends phpbb_functional_test_case
|
|||||||
array('#a00', 'GROUP_UPDATED'),
|
array('#a00', 'GROUP_UPDATED'),
|
||||||
array('ag0', 'COLOUR_INVALID'),
|
array('ag0', 'COLOUR_INVALID'),
|
||||||
array('#ag0', 'COLOUR_INVALID'),
|
array('#ag0', 'COLOUR_INVALID'),
|
||||||
|
array('##bcc', 'COLOUR_INVALID'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user