ruimarinho / google-libphonenumber

The up-to-date and reliable Google's libphonenumber package for node.js.
https://ruimarinho.github.io/google-libphonenumber
Other
1.4k stars 146 forks source link

Invalid number accepted for Germany #335

Closed cesarinmak closed 2 years ago

cesarinmak commented 2 years ago

Did not expect alphabets & special characters to be valid for Germany phone number.

PhoneNumberUtil.isViablePhoneNumber('61234b6t*', 'DE')

ruimarinho commented 2 years ago

Hi @cesarinmak,

This issue appears to be related to a metadata problem.

  1. Start by taking a look at the official demo page and see if the results are the same.
  2. If it does, you might have spotted a metadata problem on the upstream package. In this case, you should report your issue in the upstream project's issue tracker.

Sometimes you may need to do additional validations before passing the value to the library. In this particular case, libphonenumber seems to be interpreting this value as 612346, which appears to be a valid fixed line number.

Thanks!