Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipCode validation should be case insensitive #184

Open
stof opened this issue Jul 10, 2024 · 2 comments
Open

ZipCode validation should be case insensitive #184

stof opened this issue Jul 10, 2024 · 2 comments

Comments

@stof
Copy link
Contributor

stof commented Jul 10, 2024

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 ?

@yguedidi
Copy link

@ronanguilloux any news here? would you accept a PR doing the change?

@ronanguilloux
Copy link
Owner

ronanguilloux commented Aug 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants