mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +00:00
New IP methods
This commit is contained in:
parent
fe70af47dc
commit
d988b27b16
@ -46,11 +46,21 @@ class Utils extends Thread{
|
|||||||
if($ip != ""){
|
if($ip != ""){
|
||||||
return $ip;
|
return $ip;
|
||||||
}else{
|
}else{
|
||||||
$ip = trim(strip_tags(Utils::curl_get("http://checkip.dyndns.org/")));
|
trim(strip_tags(Utils::curl_get("http://checkip.dyndns.org/")));
|
||||||
if(preg_match('/Current IP Address\: (.*)/', $ip, $matches) > 0){
|
if(preg_match('#Current IP Address\: ([0-9a-fA-F\:\.]*)#', $ip, $matches) > 0){
|
||||||
return $matches[1];
|
return $matches[1];
|
||||||
}else{
|
}else{
|
||||||
return false;
|
$ip = Utils::curl_get("http://www.checkip.org/");
|
||||||
|
if(preg_match('#">([0-9a-fA-F\:\.]*)</span>#', $ip, $matches) > 0){
|
||||||
|
return $matches[1];
|
||||||
|
}else{
|
||||||
|
$ip = Utils::curl_get("http://checkmyip.org/");
|
||||||
|
if(preg_match('#Your IP address is ([0-9a-fA-F\:\.]*)#', $ip, $matches) > 0){
|
||||||
|
return $matches[1];
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user