Fix Your TLD Validation
Invalid TLD Validation Example

Fix Your TLD Validation

Here's a case of bad input validation which causes problems, several sites I've found use this "one dumb trick" for email validation -- check that the TLD is between 2 and 4 characters long and contains only ASCII alphabet characters.

No alt text provided for this image


That validation maybe have been fine quite a few years ago, but with the explosion of new TLDs this naive implementation will become more of a problem.

So, fix it! There are plenty of other ways to do your validation that are actually, you know, valid (or at least better)

ICANN List of TLDs

To view or add a comment, sign in

Explore content categories