mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #7824 from open-sausages/pulls/4/fix-password-validation
BUG Prevent invalid members being written to database if validation_enabled is false
This commit is contained in:
commit
b07babb9da
@ -1654,6 +1654,11 @@ class Member extends DataObject
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
// If validation is disabled, skip this step
|
||||
if (!DataObject::config()->uninherited('validation_enabled')) {
|
||||
return ValidationResult::create();
|
||||
}
|
||||
|
||||
$valid = parent::validate();
|
||||
$validator = static::password_validator();
|
||||
|
||||
|
@ -28,7 +28,7 @@ abstract class PasswordEncryptor
|
||||
*/
|
||||
public static function get_encryptors()
|
||||
{
|
||||
return Config::inst()->get('SilverStripe\\Security\\PasswordEncryptor', 'encryptors');
|
||||
return Config::inst()->get(self::class, 'encryptors');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user