diff options
author | Igor Wiedler <igor@wiedler.ch> | 2010-09-10 10:31:07 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2010-09-10 10:31:07 +0200 |
commit | fecca4ef21e15673c4d3fff27e528afbee127a91 (patch) | |
tree | 748614171e0fdefc4c30b68bf9c3cb86b817704d /phpBB | |
parent | 2e891c5eba78d68796dc6854d5805af2e3978641 (diff) | |
parent | 264ef66c5c5b5498df2a04e011ed0127c6fe4324 (diff) | |
download | forums-fecca4ef21e15673c4d3fff27e528afbee127a91.tar forums-fecca4ef21e15673c4d3fff27e528afbee127a91.tar.gz forums-fecca4ef21e15673c4d3fff27e528afbee127a91.tar.bz2 forums-fecca4ef21e15673c4d3fff27e528afbee127a91.tar.xz forums-fecca4ef21e15673c4d3fff27e528afbee127a91.zip |
Merge branch 'ticket/cs278/8935' into develop-olympus
* ticket/cs278/8935:
[ticket/8935] Prevent setting maximum avatar dimensions less than the minimums.
Diffstat (limited to 'phpBB')
-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 |