Forráskód Böngészése

Update IP Library

Zhu Jinhui 7 éve
szülő
commit
ec6173d031
1 módosított fájl, 5 hozzáadás és 4 törlés
  1. 5 4
      Qii/Library/IP.php

+ 5 - 4
Qii/Library/IP.php

@@ -120,12 +120,12 @@ class IP
 	{
 		if (!$dotip) return;
 
-		if (ereg("^(127)", $dotip)) {
+		if (preg_match("/^(127)/", $dotip)) {
 			$this->Country = '本地网络';
-			return;
-		} else if (ereg("^(192)", $dotip)) {
+			return $this;
+		} else if (preg_match("/^(192)/", $dotip)) {
 			$this->Country = '局域网';
-			return;
+			return $this;
 		}
 		$ip = $this->IpToInt($dotip);
 		$this->fp = fopen(__QQWRY__, "rb");
@@ -176,6 +176,7 @@ class IP
 		}
 
 		fclose($this->fp);
+              return $this;
 	}
 
 	public function IpToInt($Ip)