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

Support for extra zeros like in ::factory("192.0.2.001" ) #34

Open
gormur opened this issue Mar 20, 2023 · 1 comment
Open

Support for extra zeros like in ::factory("192.0.2.001" ) #34

gormur opened this issue Mar 20, 2023 · 1 comment

Comments

@gormur
Copy link

gormur commented Mar 20, 2023

Trying to create an IP with extra zeros in ::factory("192.0.2.01") fails with "Unable to guess IP address type from '192.0.2.01'.".
While that is a somewhat unconventional format, I would still expect it to work.
I have seen some applications where textboxes for ip input will default to a format like 000.000.000.000.

@leth
Copy link
Owner

leth commented Mar 21, 2023

This validation filter is defined by filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4); we'd need to replace that function with an alternative. Once we're past the validation, it looks like ip2long will be okay with the data!

@gormur gormur changed the title Support for extra zeros like in ::factory("192.0.2.01" ) Support for extra zeros like in ::factory("192.0.2.001" ) Aug 18, 2023
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

2 participants