Merge branch '5.1' into 5.2

This commit is contained in:
github-actions 2024-03-09 14:25:04 +00:00
commit c36df386ba

View File

@ -521,13 +521,11 @@ class Member extends DataObject
// If the algorithm or salt is not available, it means we are operating // If the algorithm or salt is not available, it means we are operating
// on legacy account with unhashed password. Do not hash the string. // on legacy account with unhashed password. Do not hash the string.
if (!$this->PasswordEncryption) { if (!$this->PasswordEncryption || !$this->Salt) {
return $string; return $string;
} }
// We assume we have PasswordEncryption and Salt available here.
$e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption); $e = PasswordEncryptor::create_for_algorithm($this->PasswordEncryption);
return $e->encrypt($string, $this->Salt); return $e->encrypt($string, $this->Salt);
} }