validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

Falsely validates multiple TLDs

Open chris-aeviator opened this issue 3 years ago • 1 comments

Describe the bug When v alidating a wrong [email protected] email with isEmail(email) I get a succesfuly validation. I understand that multiple tlds are possible in the wild (.co.uk) but more than two should not validate successfully. Better even would be only official TLDs get vaidated.

Examples

console.log(isEmail('[email protected]'))
> true

Additional context Validator.js version: 13.7 Node.js version: 17 OS platform: linux

chris-aeviator avatar Mar 28 '22 15:03 chris-aeviator

Not sure if this is a bug though. It only recognizes the last .de as TLD and the second to last as domain name. The rest can all be prefixes, right? See it as a larger extension of www.mail.example.com Or is there a limit to that extension?

WikiRik avatar Mar 28 '22 15:03 WikiRik