mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 07:29:51 +00:00
correct and unify country codes for validation
This commit is contained in:
parent
c3222f746f
commit
47f388a4c0
1 changed files with 1 additions and 1 deletions
|
@ -617,8 +617,8 @@ class Validation {
|
||||||
if (is_null($regex)) {
|
if (is_null($regex)) {
|
||||||
switch ($country) {
|
switch ($country) {
|
||||||
case 'us':
|
case 'us':
|
||||||
|
case 'ca':
|
||||||
case 'all':
|
case 'all':
|
||||||
case 'can':
|
|
||||||
// includes all NANPA members.
|
// includes all NANPA members.
|
||||||
// see http://en.wikipedia.org/wiki/North_American_Numbering_Plan#List_of_NANPA_countries_and_territories
|
// 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}$/';
|
$regex = '/^(?:\+?1)?[-. ]?\\(?[2-9][0-8][0-9]\\)?[-. ]?[2-9][0-9]{2}[-. ]?[0-9]{4}$/';
|
||||||
|
|
Loading…
Add table
Reference in a new issue