/** * Returns an IP address from an array that was passed into getLocation. This * will return an IPv4 address or false if the address is IPv6 (IPv6 is not * supported yet). * * @param array $ip Must have 'ip' key. * @return string|bool */ protected function getIpFromInfo($info) { $ip = $info['ip']; if (Piwik_IP::isMappedIPv4($ip)) { return Piwik_IP::getIPv4FromMappedIPv6($ip); } else { if (Piwik_IP::isIPv6($ip)) { return false; } else { return $ip; } } }