Merge pull request #9315 from wtom/validate_postcode_de
german postcode validation
This commit is contained in:
commit
81b4d5535d
|
@ -53,6 +53,9 @@ class WC_Validation {
|
||||||
case 'CH' :
|
case 'CH' :
|
||||||
$valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode );
|
$valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode );
|
||||||
break;
|
break;
|
||||||
|
case 'DE' :
|
||||||
|
$valid = (bool) preg_match( '/^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$/', $postcode );
|
||||||
|
break;
|
||||||
case 'GB' :
|
case 'GB' :
|
||||||
$valid = self::is_GB_postcode( $postcode );
|
$valid = self::is_GB_postcode( $postcode );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue