1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-08-07 17:42:53 +03:00

move min_password_length check into a conditional Config::has() check first

This commit is contained in:
David Goodwin
2021-01-26 20:47:45 +00:00
parent 86b91b8969
commit bcf1f8c7e4

View File

@@ -872,10 +872,12 @@ function validate_password($password) {
$result = array(); $result = array();
$val_conf = Config::read_array('password_validation'); $val_conf = Config::read_array('password_validation');
if (Config::has('min_password_length')) {
$minlen = (int)Config::read_string('min_password_length'); # used up to 2.3.x - check it for backward compatibility $minlen = (int)Config::read_string('min_password_length'); # used up to 2.3.x - check it for backward compatibility
if ($minlen > 0) { if ($minlen > 0) {
$val_conf['/.{' . $minlen . '}/'] = "password_too_short $minlen"; $val_conf['/.{' . $minlen . '}/'] = "password_too_short $minlen";
} }
}
foreach ($val_conf as $regex => $message) { foreach ($val_conf as $regex => $message) {
if (is_callable($message)) { if (is_callable($message)) {