catamphetamine / libphonenumber-js

A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
https://catamphetamine.gitlab.io/libphonenumber-js/
MIT License
2.75k stars 216 forks source link

findPhoneNumbersInText thinks the Dutch bsn is a phone number v1.11.1 #466

Closed Dagg-h closed 1 week ago

Dagg-h commented 1 week ago

In the Netherlands we have a BSN (social security number) that is either 8 or 9 numbers long and starts with a number > 0. When the second number in the bsn is a 0 the findPhoneNumbersInText (with country set to NL) function falsy assumes the number as a phone number.

Examples of such a number are:

The numbers that don't have the 0 as the second number are correctly shown as not being a number. A website you can use to test this is https://testbestanden.nl/lijst_met_geldige_bsnnummers.php

catamphetamine commented 1 week ago

Hi. It looks like you suspect that libphonenumber doesn't search for phone numbers in text correctly. If that's the case, then most likely Google's libphonenumber behavior is the same. In that case, you could report the bug to Google, as described in the readme: https://github.com/catamphetamine/libphonenumber-js?tab=readme-ov-file#bug-reporting

I personally wouldn't fix any bugs in findPhoneNumbers() function because it's simply a copy-paste of Google's code.

Dagg-h commented 1 week ago

Alright! Thanks for the quick answer. I will check it out :)