Update networktool.php
This commit is contained in:
parent
1632fcd1e8
commit
1bea7d4e58
|
@ -102,3 +102,18 @@ if(!function_exists("get_os_platform")) {
|
||||||
return $os;
|
return $os;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!function_exists("get_network_outbound_addr")) {
|
||||||
|
function get_network_outbound_addr($protocol="") {
|
||||||
|
$addr = false;
|
||||||
|
|
||||||
|
if(loadHelper("webpagetool")) {
|
||||||
|
$response = array();
|
||||||
|
$remote_host = "http://" . ($protocol == "ipv6" ? "ipv6." : "") . "icanhazip.com";
|
||||||
|
$response = get_web_json($remote_host, "get.cache");
|
||||||
|
$addr = get_value_in_array("content", $response, $addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user