feat(isMobilePhone): change the german prefix from '+490' to '+49' or '0' by AnnaMariaJansen · Pull Request #1679 · validatorjs/validator.js

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

  • [ x] PR contains only changes related; no stray files, etc.
  • [ x] README updated (where applicable)
  • [ x] Tests written (where applicable)