mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11538] Merge calls to validate_data() in acp_groups
PHPBB3-11538
This commit is contained in:
parent
b49ce5eb3a
commit
373e26ca74
1 changed files with 12 additions and 11 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue