Merge pull request #27546 from KoolPal/patch-1

Updated - Added postcode validation for India
This commit is contained in:
Claudio Sanches 2020-10-14 19:25:32 -03:00 committed by GitHub
commit 0b41aff81b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,9 @@ class WC_Validation {
case 'IE':
$valid = (bool) preg_match( '/([AC-FHKNPRTV-Y]\d{2}|D6W)[0-9AC-FHKNPRTV-Y]{4}/', wc_normalize_postcode( $postcode ) );
break;
case 'IN':
$valid = (bool) preg_match( '/^[1-9]{1}[0-9]{2}\s{0,1}[0-9]{3}$/', $postcode );
break;
case 'JP':
$valid = (bool) preg_match( '/^([0-9]{3})([-]?)([0-9]{4})$/', $postcode );
break;