From 1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 5 Dec 2014 05:06:52 +0100 Subject: Made it ipv6 ready. --- ifconfig/ifconfig.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ifconfig/ifconfig.php') diff --git a/ifconfig/ifconfig.php b/ifconfig/ifconfig.php index cf1dc8f..33ec5ba 100644 --- a/ifconfig/ifconfig.php +++ b/ifconfig/ifconfig.php @@ -19,9 +19,15 @@ class Ifconfig { } public function getAllGeoipRecords(){ + $tmp = geoip_record_by_name( $this->ip ); - unset($tmp['dma_code']); - unset($tmp['area_code']); + if( $tmp ){ + unset($tmp['dma_code']); + unset($tmp['area_code']); + } else { + $tmp = array ( "status" => "Data not available"); + } + return $tmp; } -- cgit v1.2.3