From 6148a5612659278c65d245eb50627c45f79b5d07 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Wed, 18 Dec 2019 20:02:47 +0800 Subject: [PATCH] add clear --- common/HttpClient.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/HttpClient.php b/common/HttpClient.php index 7b26302..abfb6a8 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -237,7 +237,11 @@ class HttpClient $url = str_replace('https://', '', $url); } $explode = explode('/', $url); - return System::gethostbyname(array_shift($explode)); + $first = array_shift($explode); + if (preg_match('/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/', $first)) { + return $first; + } + return System::gethostbyname($first); } /**