-
-
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
feat(isMobilePhone): change the german prefix from '+490' to '+49' or '0' #1679
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1679 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 101 101
Lines 1854 1854
=========================================
Hits 1854 1854
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for your contribution @AnnaMariaJansen . The difference between your PR and #1675 is that numbers like 15623456789
are not valid anymore?
The problem with this PR is that it doesn't resolve the fundamentally wrong implementation of german mobile phone numbers. Local landline numbers (Berlin) are still valid. A more in-depth explanation can be found here: |
We use the validator for our application and that was our main issue. Yes. These numbers should not be valid in any case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the catch!
This would fix #1670
As described mobile phone numbers in Germany start with a 0 prefix such as 0157xxxxxxx. However the preceding 0 is dropped if the country code prefix +49 is added. Therefore I restrict the regex to +49 or 0 and no +490.
I adjusted the tests and added a '0' as validation to '15123456789'.
Examples
invalid:
'15123456789'
valid:
'+4915123456789'
'015123456789'
Checklist