a semi-functional bit of code... lots of todos and error checking
[PHPIPManager.git] / lib / ip.php
index a0287f3..585643c 100644 (file)
@@ -5,6 +5,7 @@ function ipversion($ip)
        $ipv4 = ereg('^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$', $ip);
        $ipv6 = ereg("^[0-9a-fA-F:]+$", $ip);
        
+       error_log("ipversion, $ip, $ipv4, $ipv6");
        if($ipv4 == 1) return 4;
        if($ipv6 == 1) return 6;
        return 0;
@@ -98,7 +99,7 @@ class ip {
                
                if($ver == 4) {
                        if($mask != 0) {
-                               
+                               return $ip;
                        }
                }
        }
@@ -147,7 +148,7 @@ class ip {
                
                if($ver == 4) {
                        if($mask != 0) {
-                               
+                               return $ip;
                        }
                }
        }