From 47f388a4c0951d65e12dbc5393c91aa3ad7e316a Mon Sep 17 00:00:00 2001 From: euromark Date: Sat, 23 Mar 2013 22:27:40 +0100 Subject: [PATCH 1/2] correct and unify country codes for validation --- lib/Cake/Utility/Validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index 228ab6bcc..2cb7716ce 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -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}$/'; From f633e59091c41e42741971df7aeb6aa4c21c8d58 Mon Sep 17 00:00:00 2001 From: euromark Date: Sun, 24 Mar 2013 11:08:40 +0100 Subject: [PATCH 2/2] keep the deprecated three-letter-code --- lib/Cake/Utility/Validation.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index 2cb7716ce..342a6fbcc 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -618,6 +618,8 @@ class Validation { switch ($country) { case 'us': 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