Perform proper NANP validation in US/CA localflavor phone number
|Reported by:||toofishes||Owned by:||nobody|
|Severity:||Normal||Keywords:||areacode, nanp, localflavorsplit|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Long story short:
- NPA: 3 digits, 1st is [2-9], 2nd/3rd are [0-9]. 2 and 3 cannot both be '1'.
- NXX: 3 digits, 1st is [2-9], 2nd/3rd are [0-9]. 2 and 3 cannot both be '1'.
- XXXX: 4 digits, no restrictions.
Former code allowed any digit in all locations, meaning the following bogus phone numbers (now in tests as invalid) were accepted:
'023-234-5678' '123-234-5678' '323-134-5678' '312-034-5678' '311-134-5678' '312-211-5678'
Change History (4)
Changed 4 years ago by toofishes
comment:1 Changed 4 years ago by toofishes
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset