Skip to content

ZipCode validation should be case insensitive #184

Open
@stof

Description

@stof

Zipcode patterns are documented as generated from http://i18napis.appspot.com, which does not work anymore. I assume that this is similar to the data available at https://chromium-i18n.appspot.com/ssl-address for the libaddressinput of google.

When looking at the Java library for libaddressinput which consumes this data, the zipcode is matched case insensitively: https://github.com/google/libaddressinput/blob/2610f7b1043d6784ada41392fc9392d1ea09ea07/common/src/main/java/com/google/i18n/addressinput/common/FieldVerifier.java#L156-L163

This library performs case sensitive matching in

return (bool) preg_match('/^('.self::$patterns[$country].')$/', $zipcode);

Would it make sense to update the implementation to match the behavior of libaddressinput ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions