feat(isMobilePhone): change the german prefix from '+490' to '+49' or '0'#1679
feat(isMobilePhone): change the german prefix from '+490' to '+49' or '0'#1679profnandaa merged 2 commits intovalidatorjs:masterfrom
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.
|
tux-tn
left a comment
There was a problem hiding this comment.
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. |
profnandaa
left a comment
There was a problem hiding this comment.
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