mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-06-21 23:43:58 +08:00
修复部分接口请求异常
This commit is contained in:
@@ -74,6 +74,7 @@ class CheckUtils
|
||||
|
||||
public static function tcp($target, $port, $timeout)
|
||||
{
|
||||
if (substr($target, -1) == '.') $target = substr($target, 0, -1);
|
||||
if (!filter_var($target, FILTER_VALIDATE_IP) && checkDomain($target)) {
|
||||
$target = gethostbyname($target);
|
||||
if (!$target) return ['status' => false, 'errmsg' => 'DNS resolve failed', 'usetime' => 0];
|
||||
@@ -94,6 +95,7 @@ class CheckUtils
|
||||
public static function ping($target)
|
||||
{
|
||||
if (!function_exists('exec')) return ['status' => false, 'errmsg' => 'exec函数不可用', 'usetime' => 0];
|
||||
if (substr($target, -1) == '.') $target = substr($target, 0, -1);
|
||||
if (!filter_var($target, FILTER_VALIDATE_IP) && checkDomain($target)) {
|
||||
$target = gethostbyname($target);
|
||||
if (!$target) return ['status' => false, 'errmsg' => 'DNS resolve failed', 'usetime' => 0];
|
||||
|
||||
Reference in New Issue
Block a user