mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/8935] Prevent setting maximum avatar dimensions less than the minimums.
This commit is contained in:
commit
b89a4cd8d4
1 changed files with 14 additions and 0 deletions
|
@ -432,6 +432,20 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]);
|
||||
}
|
||||
|
||||
if (strpos($config_name, '_max') !== false)
|
||||
{
|
||||
// Min/max pairs of settings should ensure that min <= max
|
||||
// Replace _max with _min to find the name of the minimum
|
||||
// corresponding configuration variable
|
||||
$min_name = str_replace('_max', '_min', $config_name);
|
||||
|
||||
if (isset($cfg_array[$min_name]) && is_numeric($cfg_array[$min_name]) && $cfg_array[$config_name] < $cfg_array[$min_name])
|
||||
{
|
||||
// A minimum value exists and the maximum value is less than it
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], (int) $cfg_array[$min_name]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// Absolute path
|
||||
|
|
Loading…
Add table
Reference in a new issue