Zend Framework

Zend_Validate_Post_code

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not an Issue
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.10.1
  • Component/s: Zend_Validate
  • Labels:
    None

Description

Zend_Validate_PostCode is validating invalid postal codes as defined by Canada Post.
Locale: en_CA

For Example
"A0D 1A1" is invalid, but Zend_Validate_PostCode treats is as a success.

Reasoning:
the Letters D, F, I, O, Q, U are not valid in a postal code in any location.
Additionally, the letters W, Z are not currently used as an initial character

Example Code
$pc = new Zend_Validate_PostCode(array('locale'=>'en_CA'));
var_dump($pc->isValid('A1D1A1'));

Expected Result
bool(false)

Actual Result
bool(true)

"The alphabetic characters, D, F, I, O, Q, U, are not in use at the present time." StatsCan PCCF Reference Guide, p 32.

Activity

Hide
Thomas Weidner added a comment -

Unicode defines the postalcode for the locale CA with:

[ABCEGHJKLMNPRSTVXY]\d[A-Z][ ]?\d[A-Z]\d

When this pattern is not correct, then please fill in an issue within unicode (http://cldr.unicode.org) as ZF is build upon the unicode database.

Show
Thomas Weidner added a comment - Unicode defines the postalcode for the locale CA with:
[ABCEGHJKLMNPRSTVXY]\d[A-Z][ ]?\d[A-Z]\d
When this pattern is not correct, then please fill in an issue within unicode (http://cldr.unicode.org) as ZF is build upon the unicode database.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: