#12864 fixed deprecated

This commit is contained in:
Daniel Cebrian 2024-02-13 17:21:02 +01:00
parent c18ecd0f01
commit d10133e116
1 changed files with 2 additions and 2 deletions

View File

@ -172,12 +172,12 @@ function process_user_login_local($login, $pass, $api=false, $passAlreadyEncrypt
$credentials_check = $pass === $row['password'];
} else {
// Perform password check whether it is MD5-hashed (old hashing) or Bcrypt-hashed.
if (strlen($row['password']) === 32) {
if (strlen(($row['password'] ?? '')) === 32) {
// MD5.
$credentials_check = $row !== false && $row['password'] !== md5('') && $row['password'] == md5($pass);
} else {
// Bcrypt.
$credentials_check = password_verify($pass, $row['password']);
$credentials_check = password_verify($pass, ($row['password'] ?? ''));
}
}