You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the NANP only 8XX numbers are toll-free as stated in the perldoc. However the regex used in the implementation matches a superset of what it should. Specifically, it erroneously matches any number that starts "+18" and then contains any 2 of the digits "045678" (not necessarily the same digit).
That means numbers like "+1808xxxxxxx" are considered toll-free by this library when they are not. I've extracted the regex to demonstrate this:
The regex used in the old implementation matches a superset of what it
should of. Specifically, it erroneously matches any number that starts
"+18" and then contains any 2 of the digits "045678" (not necessarily
the same digit). The 2 digits after the 8 should be the same.
For DrHyde#110
percivalalb
added a commit
to percivalalb/perl-modules-Number-Phone
that referenced
this issue
Dec 8, 2022
Referring to the following:
perl-modules-Number-Phone/lib/Number/Phone/NANP.pm
Lines 303 to 313 in d921df1
In the NANP only 8XX numbers are toll-free as stated in the perldoc. However the regex used in the implementation matches a superset of what it should. Specifically, it erroneously matches any number that starts "+18" and then contains any 2 of the digits "045678" (not necessarily the same digit).
That means numbers like "+1808xxxxxxx" are considered toll-free by this library when they are not. I've extracted the regex to demonstrate this:
In addition a new toll-free prefix "833" has been added which the regex does not currently cover.
https://en.wikipedia.org/wiki/Toll-free_telephone_number#United_States
There is potential for other prefixes in the future. So these should be checked regularly.
I'll put together an PR to address these issues.
The text was updated successfully, but these errors were encountered: