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:
Robbie Averill 2018-02-01 18:24:29 +13:00 committed by GitHub
commit b07babb9da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1654,6 +1654,11 @@ class Member extends DataObject
*/ */
public function validate() public function validate()
{ {
// If validation is disabled, skip this step
if (!DataObject::config()->uninherited('validation_enabled')) {
return ValidationResult::create();
}
$valid = parent::validate(); $valid = parent::validate();
$validator = static::password_validator(); $validator = static::password_validator();

View File

@ -28,7 +28,7 @@ abstract class PasswordEncryptor
*/ */
public static function get_encryptors() public static function get_encryptors()
{ {
return Config::inst()->get('SilverStripe\\Security\\PasswordEncryptor', 'encryptors'); return Config::inst()->get(self::class, 'encryptors');
} }
/** /**