From 919fc6ba9bd7a72deaf084064c4b4027d9f9df9a Mon Sep 17 00:00:00 2001 From: Andrew Benbow Date: Wed, 14 May 2014 00:55:29 +0100 Subject: [PATCH] Update class-wc-validation.php Correct character 3 vaildation --- includes/class-wc-validation.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/class-wc-validation.php b/includes/class-wc-validation.php index 5e12f8bc418..f3244428d6f 100644 --- a/includes/class-wc-validation.php +++ b/includes/class-wc-validation.php @@ -78,11 +78,12 @@ class WC_Validation { public static function is_GB_postcode( $toCheck ) { // Permitted letters depend upon their position in the postcode. + // http://en.wikipedia.org/wiki/Postcodes_in_the_United_Kingdom#Validation $alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1 $alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2 - $alpha3 = "[abcdefghjkstuw]"; // Character 3 - $alpha4 = "[abehmnprvwxy]"; // Character 4 - $alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5 + $alpha3 = "[abcdefghjkpstuw]"; // Character 3 == ABCDEFGHJKPSTUW + $alpha4 = "[abehmnprvwxy]"; // Character 4 == ABEHMNPRVWXY + $alpha5 = "[abdefghjlnpqrstuwxyz]"; // Character 5 != CIKMOV // 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})$/';