Permalink
Browse files

- bugfix for Bug #5112

git-svn-id: http://svn.php.net/repository/pear/packages/Net_IPv4/trunk@201020 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent cde0968 commit b8659179bc69ae896e50dbac166c7613fda94fba @bate bate committed Nov 22, 2005
Showing with 3 additions and 6 deletions.
  1. +3 −6 IPv4.php
View
@@ -372,18 +372,15 @@ function ipInNetwork($ip, $network)
if (! is_object($network) || get_class($network) != 'net_ipv4') {
$network = Net_IPv4::parseAddress($network);
}
- if (! is_object($network) || get_class($network) != 'net_ipv4') {
- return($network);
- }
+
$net = Net_IPv4::ip2double($network->network);
$bcast = Net_IPv4::ip2double($network->broadcast);
$ip = Net_IPv4::ip2double($ip);
unset($network);
if ($ip >= $net && $ip <= $bcast) {
- return(TRUE);
+ return true;
}
- return(FALSE);
- return((double)(sprintf("%u", ip2long($ip))));
+ return false;
}
}

0 comments on commit b865917

Please sign in to comment.