#17355: Perform proper NANP validation in US/CA localflavor phone number -------------------------------------+--------------------------- Reporter: toofishes | Owner: nobody Type: Bug | Status: new Component: contrib.localflavor | Version: 1.3 Severity: Normal | Keywords: areacode nanp Triage Stage: Unreviewed | Has patch: 1 Easy pickings: 1 | UI/UX: 0 -------------------------------------+--------------------------- Patch attached.
http://en.wikipedia.org/wiki/North_American_Numbering_Plan Long story short: 1-NPA-NXX-XXXX * 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' }}} -- Ticket URL: <https://code.djangoproject.com/ticket/17355> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.