ZF-2420: Zend_Validate_Ip doesn't recognize 0.0.0.0 as a valid ip..
Description
line 62 of Zend_Validate_Ip (release-1.0.3) is "if (!ip2long($valueString)) {" shouldn't this be "if (false === ip2long($valueString)) {" since php versions >= 5.0.3 return boolean false if a string given is not an ip.
I found this from a problem with 0.0.0.0 returning 0 from ip2long and breaking my Zend_Filter_Input validation chain
Comments
Posted by Michal Minicki (martel) on 2008-01-15T03:56:29.000+0000
IP of 0.0.0.0 is in fact a valid IP address (although reserved). Fixed. Thanks, Jordan.
As a side note: I have refactored an accompanying test for more readability.
Hostname tests should also be refactored in the future because it's really hard to tell which test have failed when you iterate the array: