diff --git a/core/function.php b/core/function.php index b8656f0..016b517 100644 --- a/core/function.php +++ b/core/function.php @@ -2,7 +2,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "7.0.2"; + return "7.0.3"; }; /* 判断是否是手机 */ @@ -278,12 +278,14 @@ function _curl($url) $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_NOSIGNAL, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 3000); + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 3000); if (strpos($url, 'https') !== false) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36'); - curl_setopt($ch, CURLOPT_TIMEOUT, 5); $result = curl_exec($ch); curl_close($ch); return $result; diff --git a/core/route.php b/core/route.php index 90f1a70..b1184b5 100644 --- a/core/route.php +++ b/core/route.php @@ -313,7 +313,9 @@ function _getServerStatus($self) $request_token = md5($request_time . '' . md5($api_sk)); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_panel . '/system?action=GetNetWork'); - curl_setopt($ch, CURLOPT_TIMEOUT, 5); + curl_setopt($ch, CURLOPT_NOSIGNAL, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 3000); + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 3000); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array("request_time" => $request_time, "request_token" => $request_token)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/package.json b/package.json index 3849ea2..0c88eb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typecho-joe-next", - "version": "7.0.2", + "version": "7.0.3", "description": "A Theme Of Typecho", "main": "index.php", "keywords": [