コード例 #1
0
 /**
  * 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 $info Must have 'ip' key.
  * @return string|bool
  */
 protected function getIpFromInfo($info)
 {
     $ip = $info['ip'];
     if (IP::isMappedIPv4($ip)) {
         return IP::getIPv4FromMappedIPv6($ip);
     } else {
         if (IP::isIPv6($ip)) {
             return false;
         } else {
             return $ip;
         }
     }
 }