correct and unify country codes for validation

This commit is contained in:
euromark 2013-03-23 22:27:40 +01:00
parent c3222f746f
commit 47f388a4c0

View file

@ -617,8 +617,8 @@ class Validation {
if (is_null($regex)) {
switch ($country) {
case 'us':
case 'ca':
case 'all':
case 'can':
// includes all NANPA members.
// see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories
$regex = '/^(?:\+?1)?[-. ]?\\(?[2-9][0-8][0-9]\\)?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}$/';