Update class-wc-validation.php
Correct character 3 vaildation
This commit is contained in:
parent
2b8b483c30
commit
f8be405d45
|
@ -78,11 +78,12 @@ class WC_Validation {
|
||||||
public static function is_GB_postcode( $toCheck ) {
|
public static function is_GB_postcode( $toCheck ) {
|
||||||
|
|
||||||
// Permitted letters depend upon their position in the postcode.
|
// Permitted letters depend upon their position in the postcode.
|
||||||
|
// http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation
|
||||||
$alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1
|
$alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1
|
||||||
$alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2
|
$alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2
|
||||||
$alpha3 = "[abcdefghjkstuw]"; // Character 3
|
$alpha3 = "[abcdefghjkpstuw]"; // Character 3 == ABCDEFGHJKPSTUW
|
||||||
$alpha4 = "[abehmnprvwxy]"; // Character 4
|
$alpha4 = "[abehmnprvwxy]"; // Character 4 == ABEHMNPRVWXY
|
||||||
$alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5
|
$alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5 != CIKMOV
|
||||||
|
|
||||||
// Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA
|
// Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA
|
||||||
$pcexp[0] = '/^('.$alpha1.'{1}'.$alpha2.'{0,1}[0-9]{1,2})([0-9]{1}'.$alpha5.'{2})$/';
|
$pcexp[0] = '/^('.$alpha1.'{1}'.$alpha2.'{0,1}[0-9]{1,2})([0-9]{1}'.$alpha5.'{2})$/';
|
||||||
|
|
Loading…
Reference in New Issue