-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
False positives with German mobile phone numbers #1670
Comments
Thanks for raising. You are right, PR welcome! |
Hey guys, I have submitted a PR #1675 for this issue, but the validation of german mobile phone numbers overall is still not correct. I was wondering as to why a number such as According to Wikipedia and the federal agency of networking (Bundesnetzagentur), german mobile phone numbers always start with either
The change introduced with #1378 (#1391) is invalid as it includes local (landline) phone numbers for Berlin as well, but those are not mobile phone numbers. (See #941) Additonally, the change introduced with #933 is probably incorrect as well, as it would allow for german mobile phone numbers without a leading country code (+49) or zero (0). This only makes sense when the userland code explicitly offers two input fields where the first one already contains +49 or 0, and only the second one gets validated. Example: <input type="text" value="+49" readonly/> <input type="text" placeholder="Enter number" readonly/> But then again, this is subject to userland and shouldn't be part of this library. If it's of any help, I have created another branch called Greetings, Steve |
Describe the bug
Mobile phone numbers in Germany start with a
0
prefix such as 0157xxxxxxx. However the preceding0
is dropped if the country code prefix+49
is added. This is described on this wikipedia page. Therefore the related change made a while ago is not restrictive enough.Examples
invalid:
'+49015123456789'
valid:
'+4915123456789'
Additional context
Validator.js version: 13.6.0
Node.js version: v12.15.0
OS platform: macOS
The text was updated successfully, but these errors were encountered: