Merge pull request #1191 from dereuromark/2.4-validation

correct and unify country codes for validation
This commit is contained in:
Mark Story 2013-03-24 14:31:18 -07:00
commit 75fd460f2a

View file

@ -617,8 +617,10 @@ class Validation {
if (is_null($regex)) {
switch ($country) {
case 'us':
case 'all':
case 'ca':
// deprecated three-letter-code
case 'can':
case 'all':
// 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}$/';