diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-05-14 22:39:33 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-05-14 22:39:33 +0200 |
commit | deefe5c0e48534cea1327cf685255d109d9d7e2c (patch) | |
tree | 40c4fa50563626043ebbcefde191ab92d8f1b54c /phpBB/includes/acp/acp_groups.php | |
parent | 1fae7720e43c8ff853225e16d0de54395d9ab051 (diff) | |
download | forums-deefe5c0e48534cea1327cf685255d109d9d7e2c.tar forums-deefe5c0e48534cea1327cf685255d109d9d7e2c.tar.gz forums-deefe5c0e48534cea1327cf685255d109d9d7e2c.tar.bz2 forums-deefe5c0e48534cea1327cf685255d109d9d7e2c.tar.xz forums-deefe5c0e48534cea1327cf685255d109d9d7e2c.zip |
[ticket/11538] Simplify colour value check and remove support for '#'
The input length for the hex color is now limited to 6 characters and
the support for colors starting with a '#' has been dropped. The allowed
input length of 7 in prosilver seems to have been a relict from old ages
of phpBB3. In order to have proper support for correct checking of the
colour value, the new code was also ported to the ACP groups manage page.
The tests have been modified to reflect the changes to the behavior of
the color check. Tests for the ACP will follow.
PHPBB3-11538
Diffstat (limited to 'phpBB/includes/acp/acp_groups.php')
-rw-r--r-- | phpBB/includes/acp/acp_groups.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index beb7aefee5..3b0d53d52c 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -422,6 +422,13 @@ class acp_groups $error = array_merge($error, array_map(array(&$user, 'lang'), $max_recipients_error)); } + // Validate submitted colour value + if ($colour_error = validate_data($submit_ary, array('colour' => array('match', true, '/^([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/')))) + { + // Replace "error" string with its real, localised form + $error = array_merge($error, array_map(array(&$user, 'lang'), $colour_error)); + } + if (!sizeof($error)) { // Only set the rank, colour, etc. if it's changed or if we're adding a new |