From bcf1f8c7e43809d7ade9deb219b8b65e406d62a0 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 26 Jan 2021 20:47:45 +0000 Subject: [PATCH] move min_password_length check into a conditional Config::has() check first --- functions.inc.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 0016bf5a..368467ab 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -872,9 +872,11 @@ function validate_password($password) { $result = array(); $val_conf = Config::read_array('password_validation'); - $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"; + 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"; + } } foreach ($val_conf as $regex => $message) {