MDL-14123 Full IPv6 support - replaced mnet ip_in_range() by standard ipv6 compatible address_in_subnet(); replaced $_SERVER['REMOTE_ADDR'] with standard getremoteaddr()

This commit is contained in:
skodak
2009-01-09 21:41:47 +00:00
parent e70da470a7
commit b636fdfbc1
3 changed files with 3 additions and 32 deletions
+2 -6
View File
@@ -34,13 +34,9 @@
$in_range = false;
if (!empty($test_ip_address)) {
foreach($old_trusted_hosts as $host) {
list($network, $mask) = explode('/', $host.'/');
if (empty($network)) continue;
if (strlen($mask) == 0) $mask = 32;
if (ip_in_range($test_ip_address, $network, $mask)) {
if (address_in_subnet($test_ip_address, $host)) {
$in_range = true;
$validated_by = $network.'/'.$mask;
$validated_by = $host;
break;
}
}