Merge pull request #510 from kinglozzer/formfield-validation-extensions

NEW: Add extension hook for field-specific validation
This commit is contained in:
Guy Sartorelli 2023-02-23 09:47:43 +13:00 committed by GitHub
commit de2a8998bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ class WildcardDomainField extends TextField
public function validate($validator)
{
if ($this->checkHostname($this->Value())) {
return true;
return $this->extendValidationResult(true, $validator);
}
$validator->validationError(
@ -25,7 +25,7 @@ class WildcardDomainField extends TextField
_t('DomainNameField.INVALID_DOMAIN', 'Invalid domain name'),
'validation'
);
return false;
return $this->extendValidationResult(false, $validator);
}
/**