diff --git a/library/rules_shipping_framework.php b/library/rules_shipping_framework.php index fce5baf695d10bfffbc6326e8c904401f8d60cbe..b34b1a4836d17e69a48be80a31da46f7fe868ee9 100644 --- a/library/rules_shipping_framework.php +++ b/library/rules_shipping_framework.php @@ -348,7 +348,7 @@ class RulesShippingFramework { // Postal code Check for UK postal codes: Use regexp to determine if ZIP structure matches and also to extract the parts. // Also handle UK overseas areas/islands that use four-letter outward codes rather than "A{1,2}0{1,2}A{0,1} 0AA" $zip=strtoupper($zip); - if (isset($zip) and preg_match('/^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4}|GIR)\s*(\d[A-Z]{2})\s*$/', $zip, $match)) { + if (isset($zip) and preg_match('/^\s*(([A-Z]{1,2})(\d{1,2})([A-Z]?)|[A-Z]{4}|GIR|)\s*((\d|)([A-Z]{2}|))\s*$/', $zip, $match)) { $values['uk_outward'] = $match[1]; $values['uk_area'] = $match[2]; $values['uk_district'] = $match[3];