mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°8910 - Upgrade Symfony packages
This commit is contained in:
@@ -102,7 +102,7 @@ class IpUtils
|
||||
return self::setCacheResult($cacheKey, false);
|
||||
}
|
||||
|
||||
return self::setCacheResult($cacheKey, 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask));
|
||||
return self::setCacheResult($cacheKey, 0 === substr_compare(\sprintf('%032b', ip2long($requestIp)), \sprintf('%032b', ip2long($address)), 0, $netmask));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,6 +182,16 @@ class IpUtils
|
||||
*/
|
||||
public static function anonymize(string $ip): string
|
||||
{
|
||||
/*
|
||||
* If the IP contains a % symbol, then it is a local-link address with scoping according to RFC 4007
|
||||
* In that case, we only care about the part before the % symbol, as the following functions, can only work with
|
||||
* the IP address itself. As the scope can leak information (containing interface name), we do not want to
|
||||
* include it in our anonymized IP data.
|
||||
*/
|
||||
if (str_contains($ip, '%')) {
|
||||
$ip = substr($ip, 0, strpos($ip, '%'));
|
||||
}
|
||||
|
||||
$wrappedIPv6 = false;
|
||||
if (str_starts_with($ip, '[') && str_ends_with($ip, ']')) {
|
||||
$wrappedIPv6 = true;
|
||||
|
||||
Reference in New Issue
Block a user