Browse Source

fix: ignore invalid data for ipip.net

master
dnomd343 3 years ago
parent
commit
ee1a930aff
  1. 2
      backend/getInfo.php
  2. 11
      backend/ipip.php

2
backend/getInfo.php

@ -128,4 +128,4 @@ function getVersion() { // 获取自身及数据库版本号
return $version;
}
?>
?>

11
backend/ipip.php

@ -43,7 +43,14 @@ class IPDB {
if ($node <= 0) {
return NULL;
}
return explode("\t", $this->getData($node));
$data = explode("\t", $this->getData($node));
foreach ($data as &$field) {
$field = trim($field);
}
if ($data[1] === '中国' && $data[2] === '中国') {
$data[1] = $data[2] = '';
}
return $data;
}
private function getNode($ip) { // 获取节点编号
@ -93,4 +100,4 @@ class IPDB {
}
}
?>
?>

Loading…
Cancel
Save