From adcd894c60cc03988e850743d03a6f9150653027 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Sun, 11 Mar 2012 14:09:47 +0000 Subject: [PATCH] postcode tweak --- classes/class-wc-validation.php | 8 ++------ readme.txt | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/class-wc-validation.php b/classes/class-wc-validation.php index d5db143d25b..5a4305863e8 100644 --- a/classes/class-wc-validation.php +++ b/classes/class-wc-validation.php @@ -113,13 +113,9 @@ class WC_Validation { $postcode = trim(preg_replace('/[\s]/', '', $postcode)); if ($country=='GB') : - if (strlen($postcode)==7) - $postcode = substr_replace($postcode, ' ', 4, 0); - elseif (strlen($postcode)==5) - $postcode = substr_replace($postcode, ' ', 2, 0); - else - $postcode = substr_replace($postcode, ' ', 3, 0); + $postcode = substr_replace($postcode, ' ', -3, 0); endif; + return $postcode; } diff --git a/readme.txt b/readme.txt index 64b00238720..3059176ce8d 100644 --- a/readme.txt +++ b/readme.txt @@ -143,6 +143,10 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc == Changelog == += 1.5.2 = +* Fixed notice in GA code +* Postcode format tweak + = 1.5.1 - 08/03/2012 = * Persistent (logged-in) customer carts (thanks dominic-p) * Error suppression on set_time_out