1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-03 15:27:42 +02: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:
Igor Wiedler
2010-09-10 10:31:15 +02:00

View File

@@ -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