aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/adm/index.php')
-rw-r--r--phpBB/adm/index.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 4c568cf441..92bcf90039 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -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