Ticket #82 (new defect)

Opened 3 years ago

Last modified 3 years ago

Validation of postcodes not correct

Reported by: dom Owned by: davids
Priority: critical Milestone:
Component: Website Version:
Keywords: Cc:

Description

5-character outwards have got into our database, this shouldn't be possible.

Change History

Changed 3 years ago by dom

frantic@…:

As a rule, to parse a postcode into prefix and suffix, you should parse the
suffix first.  Postcodes always, without fail, end in 3 characters.  Remove
these 3 characters from the end and the remaining characters you are left 
with belong to the prefix which either contains 3 or 4 characters.  If you 
do this the other way around, checking the prefix first, it is difficult to
determine whether you are dealing with a 3 or 4 character prefix, which is
probably why these errors appeared.
Note: See TracTickets for help on using tickets.