🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-19 11:19:02 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
thedasstores.com
/
wp-content
/
plugins
/
when-last-login
/
includes
/
lib
📍 /home/therahul/thedasstores.com/wp-content/plugins/when-last-login/includes/lib
🔄 Refresh
✏️
Editing: IpAnonymizer.php
Writable
<?php namespace geertw\IpAnonymizer; class IpAnonymizer { /** * @var string IPv4 netmask used to anonymize IPv4 address. */ public $ipv4NetMask = "255.255.255.0"; /** * @var string IPv6 netmask used to anonymize IPv6 address. */ public $ipv6NetMask = "ffff:ffff:ffff:ffff:0000:0000:0000:0000"; /** * Anonymize an IPv4 or IPv6 address. * * @param $address string IP address that must be anonymized * @return string The anonymized IP address. Returns an empty string when the IP address is invalid. */ public static function anonymizeIp($address) { $anonymizer = new IpAnonymizer(); return $anonymizer->anonymize($address); } /** * Anonymize an IPv4 or IPv6 address. * * @param $address string IP address that must be anonymized * @return string The anonymized IP address. Returns an empty string when the IP address is invalid. */ public function anonymize($address) { $packedAddress = inet_pton($address); if (strlen($packedAddress) == 4) { return $this->anonymizeIPv4($address); } elseif (strlen($packedAddress) == 16) { return $this->anonymizeIPv6($address); } else { return ""; } } /** * Anonymize an IPv4 address * @param $address string IPv4 address * @return string Anonymized address */ public function anonymizeIPv4($address) { return inet_ntop(inet_pton($address) & inet_pton($this->ipv4NetMask)); } /** * Anonymize an IPv6 address * @param $address string IPv6 address * @return string Anonymized address */ public function anonymizeIPv6($address) { return inet_ntop(inet_pton($address) & inet_pton($this->ipv6NetMask)); } }
💾 Save Changes
❌ Cancel