summaryrefslogtreecommitdiff
path: root/includes/general.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/general.php')
-rw-r--r--includes/general.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/general.php b/includes/general.php
index 43c0ce7..ff8e90e 100644
--- a/includes/general.php
+++ b/includes/general.php
@@ -804,8 +804,6 @@
/**
* Returns the given ip address truncated to /16 (ipv4) or to /48 (ipv6)
- *
- *
*/
function anonymizeIP($ip){
$bits = @inet_pton($ip);
@@ -816,16 +814,18 @@
$bits[2] = "\0";
$bits[3] = "\0";
$newIP = @inet_ntop($bits);
- if($newIP !== false)
+ if($newIP !== false) {
$newIP .= "/16";
+ }
return $newIP;
} else if(strlen($bits) == 16) {
for($i=6;$i<16;$i++){
$bits[$i]="\0";
}
$newIP = @inet_ntop($bits);
- if($newIP !== false)
+ if($newIP !== false) {
$newIP .= "/48";
+ }
return $newIP;
}
return false;