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

Email Validator issue for double quotes and special characters #2438

Open
code0emperor opened this issue Aug 9, 2024 · 4 comments
Open

Email Validator issue for double quotes and special characters #2438

code0emperor opened this issue Aug 9, 2024 · 4 comments

Comments

@code0emperor
Copy link
Contributor

For the isEmail function, some emails like "example*."@gmail.com gets accepted due to the given below function

if(user[0] === '"' && user[user.length - 1] === '"') {
    user = user.slice(1, user.length - 1);
    return options.allow_utf8_local_part ?
      quotedEmailUserUtf8.test(user) :
      quotedEmailUser.test(user);
  }

For a valid mail, charaters like '*' and '.' should not be accepted, even when enclosed within double quotes (they should only allow some special characters and spaces). So I think the quotedEmailUserUtf8 regEx needs to be checked, but I am not sure.

@Vinayak-Nevge
Copy link

heyy!!
i want to work on this issue can i start working on it ?

@code0emperor
Copy link
Contributor Author

Go ahead

@mathewalexKerala
Copy link

is anyone working on this ? If not , can I ?

@gshpychka
Copy link

gshpychka commented Aug 22, 2024

* and . are allowed in email addresses. If quoted, a . character is also allowed as the last character of the local part: https://en.wikipedia.org/wiki/Email_address#Local-part

To sum up: "example*."@gmail.com is a valid email address.

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

Successfully merging a pull request may close this issue.

5 participants