Don't allow wildcards in the domain part
This commit is contained in:
parent
7d78df604d
commit
d812c03199
1 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ abstract class FormData
|
|||
|
||||
private static function validateMailAddress(string $address, bool $required = true, string $fieldName = 'Mail address'): ?string
|
||||
{
|
||||
// Note: This validator allows '%' as wildcard character inside mail addresses.
|
||||
// Note: This validator allows '%' as wildcard character inside the username of mail addresses.
|
||||
if (!$required && $address === '') {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ abstract class FormData
|
|||
self::validateString($address, 3, 100, $fieldName)
|
||||
);
|
||||
|
||||
if (!preg_match('/^[a-z0-9%._+-]+@[a-z0-9%.-]+$/', $address) || preg_match('/^\\.|\\.\\.|\\.@|@\\.|\\.$/', $address)) {
|
||||
if (!preg_match('/^[a-z0-9%._+-]+@[a-z0-9.-]+$/', $address) || preg_match('/^\\.|\\.\\.|\\.@|@\\.|\\.$/', $address)) {
|
||||
throw new InputValidationError("$fieldName is not valid (must be a valid mail address).");
|
||||
}
|
||||
return $address;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue