-
-
Notifications
You must be signed in to change notification settings - Fork 262
Make sure that email validators don't match unintentional non-ASCII local parts #1075
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This comment was marked as resolved.
This comment was marked as resolved.
I doubt you know this fact. Internationalized emails are not considered by the current regex even now. This is an unintended behavior and should be fixed.
Discuss it only in WHATWG, then Valibot will change only
|
This comment was marked as resolved.
This comment was marked as resolved.
commit: |
In the first place what "internationalized email addresses" match that regex? SMTPUTF8 is not supported by all MTAs. Who uses non-ASCII characters as a local part? |
Have you seen https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class_escape#w? What "accented letters" match |
Oh damn it, I mixed up regex flavors again... 😖 You're right here, JS' unicode flag doesn't do anything useful here; for some reason I was thinking with PCRE regex behavior in mind... 🙃 I marked my original comment as resolved, sorry for the confusion! ❤️ I'll open a separate issue for internationalized email support, as I still think it's an important thing to address nonetheless |
You should confirm detailed definitions of character classes in each language unless you are used to them. |
Just as a quick clarification... there is still interest in merging this PR? If so, I will review in soon. |
I took a quick look and am not sure if I want to merge it. |
Sure
This PR also disallows uncommon cases. I don't think you assume or know |
Follow-up of #1068
EMAIL_REGEX
has the same problem asRFC_EMAIL_REGEX
.Also added a test case to
email
andrfcEmail
. The latter has already been assured to be passed thanks to #1068.