diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2010-09-10 10:31:15 +0200 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2010-09-10 10:31:15 +0200 |
| commit | b89a4cd8d448c70046adc148ce7904873f666c3a (patch) | |
| tree | f3460e6f34fab14ad5e22a50d6525ddc050ce1dc | |
| parent | 2baa8c61d119707246f87372bb9e8036fcfc99fb (diff) | |
| parent | fecca4ef21e15673c4d3fff27e528afbee127a91 (diff) | |
| download | forums-b89a4cd8d448c70046adc148ce7904873f666c3a.tar forums-b89a4cd8d448c70046adc148ce7904873f666c3a.tar.gz forums-b89a4cd8d448c70046adc148ce7904873f666c3a.tar.bz2 forums-b89a4cd8d448c70046adc148ce7904873f666c3a.tar.xz forums-b89a4cd8d448c70046adc148ce7904873f666c3a.zip | |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/8935] Prevent setting maximum avatar dimensions less than the minimums.
| -rw-r--r-- | phpBB/adm/index.php | 14 |
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 |
