daddyz/phonelib

Handle "07" phone number for France

Closed this issue · 5 comments

Hi there,

I've just found that some number starting with "+33 7" or "07" which are valid number in France since 5-6 years, aren't trusted as valid.

Phonelib.parse("+33 7 28 86 67 02").valid?
=> false
Phonelib.parse("07 28 86 67 02").valid?
=> false
Phonelib.parse("0728866702").valid?
=> false
Phonelib.parse("+33 6 28 86 67 02").valid?
=> true
Phonelib.parse("06 28 86 67 02").valid?
=> true
Phonelib.parse("0628866702").valid?
=> true

Expected results are that each of theses line should be true.

How this can be patch? I can make a PR if needed.

Thanks,
Anthony

@anthonyamar according to google this is the regex for mobile for prefix 7: 7[3-9]\d{7}, meaning after 7 there should be 3-9 number, your example has 2 which is outside of the valid range. You should report to the google libphonenumber here since data of this gem is based on them. You can check here their actual result.
Second number appears to be valid.

Thank you for your answer.

I've made a report to Google's libphonenumber.
I get false to Phonelib.parse("07 28 86 67 02").valid? unfortunatly.

until they will fix this in their DB my gem will return false

Sure.
You can see how it goes on this link : https://issuetracker.google.com/issues/135596672

Ok, I have some update from Google.
This is because some range aren't attributed for now and this is why some numbers don't pass valid?. So the problem don't come from this gem but from Faker who provide 07 numbers which can't pass tests.

I tried an iteration through "0700000000" to "0799999999" (not all, but around 1m numbers) and force to see that some ranges get true and other specific false.
You can see about this here : https://issuetracker.google.com/issues/135596672
I close this issue. Thanks you for helping !