Merge pull request #24157 from marc-dll/17.0_FIX_hash_warning

FIX: installation superadmin creation: PHP 8 warning
This commit is contained in:
Laurent Destailleur 2023-03-10 14:55:25 +01:00 committed by GitHub
commit 7b04011964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -257,7 +257,7 @@ function dol_verifyHash($chain, $hash, $type = '0')
global $conf;
if ($type == '0' && !empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'password_hash' && function_exists('password_verify')) {
if ($hash[0] == '$') {
if (! empty($hash[0]) && $hash[0] == '$') {
return password_verify($chain, $hash);
} elseif (strlen($hash) == 32) {
return dol_verifyHash($chain, $hash, '3'); // md5