[Patch] Validate_UK - improve phone number validation (fixes bug 9242)
| From: | Ash Searle | Date: | Fri, 23 Feb 2007 11:14:31 +0000 |
| Subject: | [Patch] Validate_UK - improve phone number validation (fixes bug 9242) | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-45729@lists.php.net to get a copy of this message | ||
Hello,
Attached is a patch to improve the validation of UK phone numbers.
I've changed the regular-expression used based on information available from Ofcom:
- allow numbers beginning 03 (national numbers)
- numbers beginning 01 or 08 may be 10 OR 11 digits (for small towns, and old/in-use 0800 freephone numbers)
- all other numbers are 11 digits (previous reg-exp allowed 12-digit numbers)
I've added a couple of tests, and fixed an invalid test that allowed a 12-digit phone-number.
Sincerely,
Ash Searle