[pLog-svn] r3344 - plog/trunk/class/data/validator

oscar at devel.lifetype.net oscar at devel.lifetype.net
Fri May 5 20:37:34 GMT 2006


Author: oscar
Date: 2006-05-05 20:37:34 +0000 (Fri, 05 May 2006)
New Revision: 3344

Modified:
   plog/trunk/class/data/validator/ipmatchvalidator.class.php
Log:
this validator was failing for certain cases, like for 127.0.0.1 when the cidr address was 127.0.0.1/24, or basically when the ip address being validated was either the lower limit or the upper limit of the range


Modified: plog/trunk/class/data/validator/ipmatchvalidator.class.php
===================================================================
--- plog/trunk/class/data/validator/ipmatchvalidator.class.php	2006-05-05 20:36:23 UTC (rev 3343)
+++ plog/trunk/class/data/validator/ipmatchvalidator.class.php	2006-05-05 20:37:34 UTC (rev 3344)
@@ -36,8 +36,8 @@
                 $hostcount = pow(2, $hostbits)-1;
                 $ipstart = ip2long($range[0]);
                 $ipend = $ipstart + $hostcount;
-                if (ip2long($ip) > $ipstart) {
-                	if (ip2long($ip) < $ipend) {
+                if (ip2long($ip) >= $ipstart) {
+                	if (ip2long($ip) <= $ipend) {
                     	return (true);
                     }
                 }



More information about the pLog-svn mailing list