Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.2

Bug #6914 Validates wrongly formatted IP
Submitted: 2006-02-23 22:20 UTC Modified: 2006-12-15 12:47 UTC
From: manantha at gmail dot com Assigned: mj
Status: Closed Package: Net_CheckIP (version 1.2.0)
PHP Version: 4.4.0 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2006-02-23 22:20 UTC] manantha at gmail dot com (Manoj)
Description: ------------ if (Net_CheckIP::check_ip("226e+0.33.22.1")) { echo "ok"; } this returns "ok". but writing this addr into a postgresql database inet field returns an error. Instead of doing a is_numeric check on each octet, it will be better to do a is_int or a regex /^[0-9]+$/ or check the ip with this regx /^(\d+\.){3}\d+$/ Test script: --------------- <?php require_once "Net/CheckIP.php"; if (Net_CheckIP::check_ip("226e+0.33.22.1")) { echo "ok"; } else { echo "no"; } ?>

Comments

 [2006-12-15 12:42 UTC] mj (Martin Jansen)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.
 [2006-12-15 12:47 UTC] mj (Martin Jansen)
Net_CheckIP 1.2.1 has been released that contains a fix for this.