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

isMobilePhone en-US locale accepts non-NANPA numbers with country code #917

Closed
DanielleB-R opened this issue Oct 23, 2018 · 3 comments · Fixed by #931
Closed

isMobilePhone en-US locale accepts non-NANPA numbers with country code #917

DanielleB-R opened this issue Oct 23, 2018 · 3 comments · Fixed by #931

Comments

@DanielleB-R
Copy link

The en-US locale of isMobilePhone erroneously accepts some foreign numbers, if they are the correct length including the country code. +6425864074 is a (fake) New Zealand mobile phone number, and not a valid NANPA number, but isMobilePhone('+6425864074', 'en-US') returns true.

It appears that the regex treats the + and 1 at the beginning as separately optional, but the 1 is not optional for this locale after a +.

@profnandaa
Copy link
Member

Thanks for raising, will check it out. A fix PR is also welcome 👍

@tolgaduzenli
Copy link

Any work on this bug ? is that coming with new release ?

@profnandaa
Copy link
Member

@tolgaduzenli - a PR is welcome.

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.

3 participants