diff --git a/src/StringParser.php b/src/StringParser.php index 079a937..0b74e97 100644 --- a/src/StringParser.php +++ b/src/StringParser.php @@ -104,6 +104,12 @@ public static function parse($location, $withOriginal = false) return $result; } + //ipv6 会包含中国 故意去掉 + + if (strpos($location['country'], "中国") === 0) { + $location['country'] = str_replace("中国", "", $location['country']); + } + $location['org_country'] = $location['country']; //北京市朝阳区 $location['org_area'] = $location['area']; // 金桥国际小区 diff --git a/tests/ip.php b/tests/ip.php index e0f2517..fffc937 100644 --- a/tests/ip.php +++ b/tests/ip.php @@ -32,7 +32,9 @@ "162.105.217.0", //,"province":"北京大学万柳学区","ci "fe80:0000:0001:0000:0440:44ff:1233:5678", - "2409:8900:103f:14f:d7e:cd36:11af:be83" + "2409:8900:103f:14f:d7e:cd36:11af:be83", + "2400:3200:baba::1",//阿里云 + ];