0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

stop non-string value for length breaking stuff - see https://github.com/postfixadmin/postfixadmin/issues/697 - thanks @bmatthewshea

This commit is contained in:
David Goodwin 2022-12-30 20:41:28 +00:00
parent b7cf7e040c
commit 919e5a7834

View File

@ -877,10 +877,14 @@ function validate_password($password) {
$result = array();
$val_conf = Config::read_array('password_validation');
# legacy, used up to 2.3.x - check for backwards compatability.
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
if ($minlen > 0) {
$val_conf['/.{' . $minlen . '}/'] = "password_too_short $minlen";
$val = Config::read('min_password_length');
if (is_numeric($val)) {
$minlen = (int) $val;
if ($minlen > 0) {
$val_conf['/.{' . $minlen . '}/'] = "password_too_short $minlen";
}
}
}