Fix settings value for password requirements

pull/4826/head
Angel Fernando Quiroz Campos 1 year ago
parent d15930f5a8
commit 77243202c7
  1. 2
      public/main/inc/lib/api.lib.php
  2. 2
      public/main/inc/lib/security.lib.php

@ -2231,7 +2231,7 @@ function api_generate_password(int $length = 8, $useRequirements = true): string
$factory = new RandomLib\Factory();
$generator = $factory->getGenerator(new SecurityLib\Strength(SecurityLib\Strength::MEDIUM));
if (is_array($passwordRequirements)) {
if (!empty($passwordRequirements)) {
$length = $passwordRequirements['min']['length'];
$minNumbers = $passwordRequirements['min']['numeric'];
$minLowerCase = $passwordRequirements['min']['lowercase'];

@ -548,7 +548,7 @@ class Security
];
$passwordRequirements = api_get_setting('security.password_requirements', true);
if (is_array($passwordRequirements)) {
if (!empty($passwordRequirements)) {
$requirements = $passwordRequirements;
}

Loading…
Cancel
Save