RE: Emails with no top level domain suffix are coming through as valid
I'm using Laravel, which utilizes this library under the hood. I have an email which is coming through as valid but i don't think it should be. I'm not across the current standard oh what constitutes a valid email, but i assume it would need a top level suffix of some sort.
sales@test is the email that comes back as valid
$email = 'sales@test';
$validator = \Validator::make(['email' => $email], [
'email' => 'required|email',
]);
try {
$validator->validate();
} catch (\Exception $e) {
dd('invalid');
}
dd('valid');
Please take a look at this, I am facing the same issue here!
Same issue. If this is expected behavior, please give us a simple way to override it.
Hi folks. Apologies for the delay. This is the expected behaviour, as email RFCs do not explicitly state there should be a TLD.
Now, reflecting on this and given that I'm following RFC 1035 for the domain part, it is true it should require to have a TLD.
Will work on this.
I'm not well versed in creating & using lexers, but I'm going to guess the issue lies here as that's the only place $tldMissing is set to false, when it should be true in an example@notld input.