Check IPV6 support and add log

Closes #12580
This commit is contained in:
Mike Jolley 2016-12-13 12:35:25 +00:00
parent 6cf565c122
commit dad7dcbf4b
1 changed files with 5 additions and 1 deletions

View File

@ -1629,9 +1629,13 @@ class WC_Geo_IP {
* Country ID by addr IPv6.
*
* @param string $addr
* @return int
* @return int|bool
*/
public function geoip_country_id_by_addr_v6( $addr ) {
if ( defined( 'AF_INET6' ) ) {
$this->log( 'GEOIP (geoip_country_id_by_addr_v6): PHP was compiled without --disable-ipv6 option' );
return false;
}
$ipnum = inet_pton( $addr );
return $this->_geoip_seek_country_v6( $ipnum ) - self::GEOIP_COUNTRY_BEGIN;
}