Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect TLD length in email validation #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhwheeler
Copy link

@jhwheeler jhwheeler commented Sep 11, 2024

The email validator has a character length restriction between 2 and 7 characters.

However, there are valid TLDs that are longer than that, e.g. .technology, .international, .photography, .university, .solutions, .foundation, etc. In this list of all currently valid TLDs, there are many that are longer than 7 characters; it seems that the maximum length currently in use is 24. In fact, TLDs per the ICANN spec can be up to 63 characters, according to MDN.

The solution is to change the maximum length in the regex from 7 to 63.

Merging this would close #119.

The email validator has a character length restriction between 2 and 7 characters.

However, there are valid TLDs that are longer than that, e.g. .technology, .international, .photography, .university, .solutions, .foundation, etc. In [this list of all currently valid TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt), there are many that are longer than 7 characters; it seems that the maximum length currently in use is 24. In fact, TLDs per the ICANN spec can be up to [63 characters, according to MDN](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_domain_name).

The solution is to change the maximum length in the regex from 7 to 63.
@jhwheeler
Copy link
Author

@chainlist Any update on this? Review should hopefully be quite straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Email validation excludes valid email addresses with TLDs longer than 7 characters
1 participant