mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Generate salt if needed
This commit is contained in:
parent
d33332cb9e
commit
e7bc8ae99f
@ -524,9 +524,14 @@ class Member extends DataObject
|
|||||||
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);
|
||||||
|
|
||||||
|
// If we don't have a salt, don't allow invalid calls to encrypt method
|
||||||
|
if (!$this->Salt) {
|
||||||
|
$this->Salt = $e->salt($string, $this);
|
||||||
|
$this->write();
|
||||||
|
}
|
||||||
|
|
||||||
return $e->encrypt($string, $this->Salt);
|
return $e->encrypt($string, $this->Salt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user