1) The historical workaround of testing IPv4 for validity by (a) converting to long (b) converting back again, then (c) comparing to see if it's the same as the original, is redundant. The old issue with ip2long() was fixed in PHP 5.2.10 and invalid IPv4 can now be tested simply by ip2long() === FALSE.
2) The workaround didn't really work optimally anyway as it mis-reported otherwise valid IPs as invalid if any octet or the IP as a whole was zero padded. Some IP lists or IP data sources users might use could be zero padded - an avoidable headache.
simplify is_ipaddrv4() and fix zero-padding issue
Fixes these two issues:
1) The historical workaround of testing IPv4 for validity by (a) converting to long (b) converting back again, then (c) comparing to see if it's the same as the original, is redundant. The old issue with ip2long() was fixed in PHP 5.2.10 and invalid IPv4 can now be tested simply by ip2long() === FALSE.
2) The workaround didn't really work optimally anyway as it mis-reported otherwise valid IPs as invalid if any octet or the IP as a whole was zero padded. Some IP lists or IP data sources users might use could be zero padded - an avoidable headache.