You've already forked postfixadmin
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user