toIPv4() ?? $parsedIp); } else { $ip = (string)$parsedIp; } if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) { /* Range address */ return true; } if (IpUtils::checkIp($ip, self::LOCAL_ADDRESS_RANGES)) { /* Within local range */ return true; } return false; } }