From 373e26ca746699f466e768406b951e6cf09ed284 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 19 May 2013 11:38:11 +0200 Subject: [PATCH] [ticket/11538] Merge calls to validate_data() in acp_groups PHPBB3-11538 --- phpBB/includes/acp/acp_groups.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 25df9e357e..bddad78bf2 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -413,20 +413,21 @@ class acp_groups } } - // Validate the length of "Maximum number of allowed recipients per private message" setting. - // We use 16777215 as a maximum because it matches MySQL unsigned mediumint maximum value - // which is the lowest amongst DBMSes supported by phpBB3 - if ($max_recipients_error = validate_data($submit_ary, array('max_recipients' => array('num', false, 0, 16777215)))) - { - // Replace "error" string with its real, localised form - $error = array_merge($error, array_map(array(&$user, 'lang'), $max_recipients_error)); - } + /* + * Validate the length of "Maximum number of allowed recipients per private message" setting. + * We use 16777215 as a maximum because it matches MySQL unsigned mediumint maximum value + * which is the lowest amongst DBMSes supported by phpBB3. + * Also validate the submitted colour value. + */ + $validation_checks = array( + 'max_recipients' => array('num', false, 0, 16777215), + 'colour' => array('hex_colour'), + ); - // Validate submitted colour value - if ($colour_error = validate_data($submit_ary, array('colour' => array('hex_colour')))) + if ($validation_error = validate_data($submit_ary, $validation_checks)) { // Replace "error" string with its real, localised form - $error = array_merge($error, array_map(array(&$user, 'lang'), $colour_error)); + $error = array_merge($error, array_map(array(&$user, 'lang'), $validation_error)); } if (!sizeof($error))