diff --git a/app/common.php b/app/common.php index 0f3bcc3..f367fc1 100644 --- a/app/common.php +++ b/app/common.php @@ -11,7 +11,6 @@ function get_curl($url, $post = 0, $referer = 0, $cookie = 0, $ua = 0, $nobody = 'timeout' => 10, 'verify' => false, 'headers' => [ - 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => $ua ?: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' ], 'http_errors' => false // 不抛出异常 @@ -28,6 +27,9 @@ function get_curl($url, $post = 0, $referer = 0, $cookie = 0, $ua = 0, $nobody = $method = 'GET'; if ($post) { $method = 'POST'; + if (!isset($options['headers']['Content-Type'])) { + $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded'; + } if (is_array($post)) { $options['form_params'] = $post; } else { @@ -390,7 +392,7 @@ function clearDirectory($dir): bool return true; } -function curl_client($url, $data = null, $referer = null, $cookie = null, $headers = null, $proxy = false, $method = null, $timeout = 5) +function http_request($url, $data = null, $referer = null, $cookie = null, $headers = null, $proxy = false, $method = null, $timeout = 5) { $options = [ 'timeout' => $timeout, @@ -398,7 +400,6 @@ function curl_client($url, $data = null, $referer = null, $cookie = null, $heade 'allow_redirects' => false, 'verify' => false, 'headers' => [ - 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36', ], 'http_errors' => false // 不抛出异常 @@ -423,6 +424,9 @@ function curl_client($url, $data = null, $referer = null, $cookie = null, $heade // 处理数据 if ($data) { if ($method !== 'GET') { + if (!isset($options['headers']['Content-Type'])) { + $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded'; + } $options['body'] = $data; } else { // 兼容已经存在查询字符串的情况 diff --git a/app/lib/cert/google.php b/app/lib/cert/google.php index 253f21e..2f67bc5 100644 --- a/app/lib/cert/google.php +++ b/app/lib/cert/google.php @@ -128,7 +128,7 @@ class google implements CertInterface private function getEAB() { $api = "https://gts.rat.dev/eab"; - $response = curl_client($api, null, null, null, null, $this->config['proxy'] == 1, 'GET', 10); + $response = http_request($api, null, null, null, null, $this->config['proxy'] == 1, 'GET', 10); $result = json_decode($response['body'], true); if (!isset($result['msg'])) { throw new Exception('解析返回数据失败:' . $response['body']); diff --git a/app/lib/cert/tencent.php b/app/lib/cert/tencent.php index 46dda34..8260aa3 100644 --- a/app/lib/cert/tencent.php +++ b/app/lib/cert/tencent.php @@ -110,7 +110,7 @@ class tencent implements CertInterface 'ServiceType' => 'nginx', ]; $data = $this->request('DescribeDownloadCertificateUrl', $param); - $file_data = curl_client($data['DownloadCertificateUrl'], null, null, null, null, $this->proxy); + $file_data = http_request($data['DownloadCertificateUrl'], null, null, null, null, $this->proxy); $file_data = $file_data['body'] ?? null; if (empty($file_data)) throw new Exception('下载证书失败'); $file_path = app()->getRuntimePath() . 'cert/' . $data['DownloadFilename']; diff --git a/app/lib/cert/zerossl.php b/app/lib/cert/zerossl.php index 08c7228..ebdbbfc 100644 --- a/app/lib/cert/zerossl.php +++ b/app/lib/cert/zerossl.php @@ -120,7 +120,7 @@ class zerossl implements CertInterface private function getEAB($email) { $api = "https://api.zerossl.com/acme/eab-credentials-email"; - $response = curl_client($api, http_build_query(['email' => $email]), null, null, null, $this->config['proxy'] == 1); + $response = http_request($api, http_build_query(['email' => $email]), null, null, null, $this->config['proxy'] == 1); $result = json_decode($response['body'], true); if (!isset($result['success'])) { throw new Exception('获取EAB失败:' . $response['body']); diff --git a/app/lib/deploy/baishan.php b/app/lib/deploy/baishan.php index 3a4a262..61915e3 100644 --- a/app/lib/deploy/baishan.php +++ b/app/lib/deploy/baishan.php @@ -59,7 +59,7 @@ class baishan implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy); + $response = http_request($url, $body, null, null, $headers, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['code']) && $result['code'] == 0) { return $result; diff --git a/app/lib/deploy/btpanel.php b/app/lib/deploy/btpanel.php index 94b2686..f7d2bb7 100644 --- a/app/lib/deploy/btpanel.php +++ b/app/lib/deploy/btpanel.php @@ -179,7 +179,7 @@ class btpanel implements DeployInterface 'request_time' => $now_time ]; $post_data = array_merge($post_data, $params); - $response = curl_client($url, $post_data, null, null, null, $this->proxy); + $response = http_request($url, $post_data, null, null, null, $this->proxy); return $response['body']; } } diff --git a/app/lib/deploy/btwaf.php b/app/lib/deploy/btwaf.php index d01c67d..a0ac74d 100644 --- a/app/lib/deploy/btwaf.php +++ b/app/lib/deploy/btwaf.php @@ -128,7 +128,7 @@ class btwaf implements DeployInterface 'Content-Type' => 'application/json', ]; $post = $params ? json_encode($params) : null; - $response = curl_client($url, $post, null, null, $headers, $this->proxy, 'POST'); + $response = http_request($url, $post, null, null, $headers, $this->proxy, 'POST'); return $response['body']; } } diff --git a/app/lib/deploy/cachefly.php b/app/lib/deploy/cachefly.php index e8beeb8..0c03996 100644 --- a/app/lib/deploy/cachefly.php +++ b/app/lib/deploy/cachefly.php @@ -43,7 +43,7 @@ class cachefly implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); $result = json_decode($response['body'], true); if ($response['code'] >= 200 && $response['code'] < 300) { return $result; diff --git a/app/lib/deploy/cdnfly.php b/app/lib/deploy/cdnfly.php index 35fcf9f..80e59e5 100644 --- a/app/lib/deploy/cdnfly.php +++ b/app/lib/deploy/cdnfly.php @@ -50,7 +50,7 @@ class cdnfly implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); $result = json_decode($response['body'], true); if (isset($result['code']) && $result['code'] == 0) { return isset($result['data']) ? $result['data'] : null; diff --git a/app/lib/deploy/doge.php b/app/lib/deploy/doge.php index 597770c..06e2d76 100644 --- a/app/lib/deploy/doge.php +++ b/app/lib/deploy/doge.php @@ -98,7 +98,7 @@ class doge implements DeployInterface $headers = ['Authorization' => $authorization]; if($body && $json) $headers['Content-Type'] = 'application/json'; $url = 'https://api.dogecloud.com'.$path; - $response = curl_client($url, $body, null, null, $headers, $this->proxy); + $response = http_request($url, $body, null, null, $headers, $this->proxy); $result = json_decode($response['body'], true); if(isset($result['code']) && $result['code'] == 200){ return $result['data'] ?? true; diff --git a/app/lib/deploy/gcore.php b/app/lib/deploy/gcore.php index 181ff63..a779d56 100644 --- a/app/lib/deploy/gcore.php +++ b/app/lib/deploy/gcore.php @@ -48,7 +48,7 @@ class gcore implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); $result = json_decode($response['body'], true); if ($response['code'] >= 200 && $response['code'] < 300) { return $result; diff --git a/app/lib/deploy/goedge.php b/app/lib/deploy/goedge.php index e08f636..0bbcdcd 100644 --- a/app/lib/deploy/goedge.php +++ b/app/lib/deploy/goedge.php @@ -128,7 +128,7 @@ class goedge implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy); + $response = http_request($url, $body, null, null, $headers, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['code']) && $result['code'] == 200) { return $result['data'] ?? null; diff --git a/app/lib/deploy/kangle.php b/app/lib/deploy/kangle.php index 89c8c5a..707490a 100644 --- a/app/lib/deploy/kangle.php +++ b/app/lib/deploy/kangle.php @@ -71,7 +71,7 @@ class kangle implements DeployInterface 'certificate' => $fullchain, 'certificate_key' => $privatekey, ]; - $response = curl_client($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); + $response = http_request($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); if (strpos($response['body'], '成功')) { return true; } elseif (preg_match('/alert\(\'(.*?)\'\)/i', $response['body'], $match)) { @@ -90,7 +90,7 @@ class kangle implements DeployInterface 'certificate' => $fullchain, 'certificate_key' => $privatekey, ]; - $response = curl_client($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); + $response = http_request($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); if (strpos($response['body'], '成功')) { return true; } elseif (preg_match('/alert\(\'(.*?)\'\)/i', $response['body'], $match)) { @@ -114,7 +114,7 @@ class kangle implements DeployInterface private function loginBySkey() { $url = $this->url . '/vhost/index.php?c=sso&a=hello&url=' . urlencode($this->url . '/index.php?'); - $response = curl_client($url, null, null, null, null, $this->proxy); + $response = http_request($url, null, null, null, null, $this->proxy); if ($response['code'] == 302 && !empty($response['redirect_url'])) { $cookie = ''; if (isset($response['headers']['Set-Cookie'])) { @@ -147,7 +147,7 @@ class kangle implements DeployInterface { $s = md5($sess_key . $this->username . $sess_key . $this->skey); $url = $this->url . '/vhost/index.php?c=sso&a=login&name=' . $this->username . '&r=' . $sess_key . '&s=' . $s; - $response = curl_client($url, null, null, $cookie, null, $this->proxy); + $response = http_request($url, null, null, $cookie, null, $this->proxy); if ($response['code'] == 302) { return true; } elseif (strlen($response['body']) > 3 && strlen($response['body']) < 50) { @@ -165,7 +165,7 @@ class kangle implements DeployInterface 'username' => $this->username, 'passwd' => $this->password, ]; - $response = curl_client($url, http_build_query($post), $referer, null, null, $this->proxy); + $response = http_request($url, http_build_query($post), $referer, null, null, $this->proxy); if ($response['code'] == 302) { $cookie = ''; if (isset($response['headers']['Set-Cookie'])) { @@ -191,7 +191,7 @@ class kangle implements DeployInterface private function getMain() { $path = '/vhost/'; - curl_client($this->url . $path, null, null, $this->cookie, null, $this->proxy); + http_request($this->url . $path, null, null, $this->cookie, null, $this->proxy); } public function setLogger($func) diff --git a/app/lib/deploy/kangleadmin.php b/app/lib/deploy/kangleadmin.php index c3cb696..6da0a57 100644 --- a/app/lib/deploy/kangleadmin.php +++ b/app/lib/deploy/kangleadmin.php @@ -71,7 +71,7 @@ class kangleadmin implements DeployInterface 'certificate' => $fullchain, 'certificate_key' => $privatekey, ]; - $response = curl_client($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); + $response = http_request($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); if (strpos($response['body'], '成功')) { return true; } elseif (preg_match('/alert\(\'(.*?)\'\)/i', $response['body'], $match)) { @@ -90,7 +90,7 @@ class kangleadmin implements DeployInterface 'certificate' => $fullchain, 'certificate_key' => $privatekey, ]; - $response = curl_client($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); + $response = http_request($this->url . $path, http_build_query($post), null, $this->cookie, null, $this->proxy); if (strpos($response['body'], '成功')) { return true; } elseif (preg_match('/alert\(\'(.*?)\'\)/i', $response['body'], $match)) { @@ -105,7 +105,7 @@ class kangleadmin implements DeployInterface private function login() { $url = $this->url . $this->path . '/index.php?c=sso&a=hello&url=' . urlencode($this->url . $this->path . '/index.php?'); - $response = curl_client($url, null, null, null, null, $this->proxy); + $response = http_request($url, null, null, null, null, $this->proxy); if ($response['code'] == 302 && !empty($response['redirect_url'])) { $cookie = ''; if (isset($response['headers']['Set-Cookie'])) { @@ -138,7 +138,7 @@ class kangleadmin implements DeployInterface { $s = md5($sess_key . $this->username . $sess_key . $this->skey); $url = $this->url . $this->path . '/index.php?c=sso&a=login&name=' . $this->username . '&r=' . $sess_key . '&s=' . $s; - $response = curl_client($url, null, null, $cookie, null, $this->proxy); + $response = http_request($url, null, null, $cookie, null, $this->proxy); if ($response['code'] == 302) { return true; } elseif (strlen($response['body']) > 3 && strlen($response['body']) < 50) { @@ -151,9 +151,9 @@ class kangleadmin implements DeployInterface private function loginVhost($name) { $url = $this->url . $this->path . '/index.php?c=vhost&a=impLogin&name=' . $name; - $response = curl_client($url, null, null, $this->cookie, null, $this->proxy); + $response = http_request($url, null, null, $this->cookie, null, $this->proxy); if ($response['code'] == 302) { - curl_client($this->url . '/vhost/', null, null, $this->cookie, null, $this->proxy); + http_request($this->url . '/vhost/', null, null, $this->cookie, null, $this->proxy); } else { throw new Exception('用户面板登录失败 (httpCode=' . $response['code'] . ')'); } diff --git a/app/lib/deploy/kuocai.php b/app/lib/deploy/kuocai.php index e205d22..4d2d1e6 100644 --- a/app/lib/deploy/kuocai.php +++ b/app/lib/deploy/kuocai.php @@ -74,7 +74,7 @@ class kuocai implements DeployInterface $body = $json ? json_encode($params) : $params; $headers = []; if ($json) $headers['Content-Type'] = 'application/json'; - $response = curl_client( + $response = http_request( $url, $body, null, diff --git a/app/lib/deploy/lecdn.php b/app/lib/deploy/lecdn.php index f30dead..6e55940 100644 --- a/app/lib/deploy/lecdn.php +++ b/app/lib/deploy/lecdn.php @@ -82,7 +82,7 @@ class lecdn implements DeployInterface $headers['Content-Type'] = 'application/json;charset=UTF-8'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); $result = json_decode($response['body'], true); if (isset($result['code']) && $result['code'] == 200) { return $result['data'] ?? null; diff --git a/app/lib/deploy/mwpanel.php b/app/lib/deploy/mwpanel.php index f536f57..ed79c89 100644 --- a/app/lib/deploy/mwpanel.php +++ b/app/lib/deploy/mwpanel.php @@ -121,7 +121,7 @@ class mwpanel implements DeployInterface 'app-id' => $this->appid, 'app-secret' => $this->appsecret, ]; - $response = curl_client($url, $params ? http_build_query($params) : null, null, null, $headers, $this->proxy); + $response = http_request($url, $params ? http_build_query($params) : null, null, null, $headers, $this->proxy); return $response['body']; } } diff --git a/app/lib/deploy/opanel.php b/app/lib/deploy/opanel.php index 92cdc83..19f4ee6 100644 --- a/app/lib/deploy/opanel.php +++ b/app/lib/deploy/opanel.php @@ -101,7 +101,7 @@ class opanel implements DeployInterface ]; $body = $params ? json_encode($params) : '{}'; if ($body) $headers['Content-Type'] = 'application/json'; - $response = curl_client($url, $body, null, null, $headers, $this->proxy); + $response = http_request($url, $body, null, null, $headers, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['code']) && $result['code'] == 200) { return $result['data'] ?? null; diff --git a/app/lib/deploy/proxmox.php b/app/lib/deploy/proxmox.php index f586afc..80ae5cc 100644 --- a/app/lib/deploy/proxmox.php +++ b/app/lib/deploy/proxmox.php @@ -61,7 +61,7 @@ class proxmox implements DeployInterface $url = $this->url . $path; $headers = ['Authorization' => 'PVEAPIToken=' . $this->api_user . '=' . $this->api_key]; $post = $params ? http_build_query($params) : null; - $response = curl_client($url, $post, null, null, $headers, $this->proxy); + $response = http_request($url, $post, null, null, $headers, $this->proxy); if ($response['code'] == 200) { $result = json_decode($response['body'], true); if (isset($result['data'])) { diff --git a/app/lib/deploy/ratpanel.php b/app/lib/deploy/ratpanel.php index 4b272fb..0038e08 100644 --- a/app/lib/deploy/ratpanel.php +++ b/app/lib/deploy/ratpanel.php @@ -113,7 +113,7 @@ class ratpanel implements DeployInterface $url = $this->url . '/api' . $path; $body = $method == 'GET' ? null : json_encode($params); $sign = $this->signRequest($method, $url, $body, $this->id, $this->token); - $response = curl_client($url, $body, null, null, [ + $response = http_request($url, $body, null, null, [ 'Content-Type' => 'application/json', 'X-Timestamp' => $sign['timestamp'], 'Authorization' => 'HMAC-SHA256 Credential=' . $sign['id'] . ', Signature=' . $sign['signature'] diff --git a/app/lib/deploy/safeline.php b/app/lib/deploy/safeline.php index e932033..59698b7 100644 --- a/app/lib/deploy/safeline.php +++ b/app/lib/deploy/safeline.php @@ -89,7 +89,7 @@ class safeline implements DeployInterface $headers['Content-Type'] = 'application/json'; $body = json_encode($params); } - $response = curl_client($url, $body, null, null, $headers, $this->proxy); + $response = http_request($url, $body, null, null, $headers, $this->proxy); $result = json_decode($response['body'], true); if ($response['code'] == 200 && $result) { return $result['data'] ?? null; diff --git a/app/lib/deploy/synology.php b/app/lib/deploy/synology.php index 8a79426..2d2ee63 100644 --- a/app/lib/deploy/synology.php +++ b/app/lib/deploy/synology.php @@ -43,7 +43,7 @@ class synology implements DeployInterface 'format' => 'sid', 'enable_syno_token' => 'yes', ]; - $response = curl_client($url, http_build_query($params), null, null, null, $this->proxy); + $response = http_request($url, http_build_query($params), null, null, null, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['success']) && $result['success']) { $this->token = $result['data']; @@ -69,7 +69,7 @@ class synology implements DeployInterface '_sid' => $this->token['sid'], 'SynoToken' => $this->token['synotoken'], ]; - $response = curl_client($url . '?' . http_build_query($params), null, null, $this->proxy); + $response = http_request($url . '?' . http_build_query($params), null, null, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['success']) && $result['success']) { $this->log('获取证书列表成功'); @@ -119,7 +119,7 @@ class synology implements DeployInterface 'id' => $id, 'desc' => $config['desc'], ]; - $response = curl_client($url . '?' . http_build_query($params), $post, null, null, null, $this->proxy, null, 15); + $response = http_request($url . '?' . http_build_query($params), $post, null, null, null, $this->proxy, null, 15); unlink($privatekey_file); unlink($fullchain_file); $result = json_decode($response['body'], true); diff --git a/app/lib/deploy/upyun.php b/app/lib/deploy/upyun.php index c14e776..fd4b994 100644 --- a/app/lib/deploy/upyun.php +++ b/app/lib/deploy/upyun.php @@ -35,7 +35,7 @@ class upyun implements DeployInterface 'certificate' => $fullchain, 'private_key' => $privatekey, ]; - $response = curl_client($url, http_build_query($params), null, $this->cookie, null, $this->proxy); + $response = http_request($url, http_build_query($params), null, $this->cookie, null, $this->proxy); $result = json_decode($response['body'], true); if ($result['data']['status'] === 0) { $common_name = $result['data']['result']['commonName']; @@ -52,7 +52,7 @@ class upyun implements DeployInterface 'limit' => 100, 'domain' => $common_name, ]; - $response = curl_client($url . '?' . http_build_query($params), null, null, $this->cookie, null, $this->proxy); + $response = http_request($url . '?' . http_build_query($params), null, null, $this->cookie, null, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['data']['result']) && is_array($result['data']['result'])) { $cert_list = $result['data']['result']; @@ -73,7 +73,7 @@ class upyun implements DeployInterface 'new_crt_id' => $certificate_id, 'old_crt_id' => $crt_id, ]; - $response = curl_client($url, http_build_query($params), null, $this->cookie, null, $this->proxy); + $response = http_request($url, http_build_query($params), null, $this->cookie, null, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['data']['result']) && $result['data']['result'] == true) { $i++; @@ -97,7 +97,7 @@ class upyun implements DeployInterface 'username' => $this->username, 'password' => $this->password, ]; - $response = curl_client($url, http_build_query($params), null, null, null, $this->proxy); + $response = http_request($url, http_build_query($params), null, null, null, $this->proxy); $result = json_decode($response['body'], true); if (isset($result['data']['result']) && $result['data']['result'] == true) { $cookie = ''; diff --git a/app/lib/deploy/wangsu.php b/app/lib/deploy/wangsu.php index 77657a3..f9cd555 100644 --- a/app/lib/deploy/wangsu.php +++ b/app/lib/deploy/wangsu.php @@ -433,7 +433,7 @@ class wangsu implements DeployInterface } $url = 'https://open.chinanetcenter.com' . $path; - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method, 30); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method, 30); $result = json_decode($response['body'], true); if ((isset($response['code']) && $response['code'] == 201) || (isset($response['code']) && $response['code'] == 200 && $getLocation === true)) { diff --git a/app/lib/deploy/west.php b/app/lib/deploy/west.php index c96b223..ac357d0 100644 --- a/app/lib/deploy/west.php +++ b/app/lib/deploy/west.php @@ -103,7 +103,7 @@ class west implements DeployInterface $params['username'] = $this->username; $params['time'] = getMillisecond(); $params['token'] = md5($this->username . $this->api_password . $params['time']); - $response = curl_client($this->baseUrl . $path, str_replace('+', '%20', http_build_query($params)), null, null, null, $this->proxy); + $response = http_request($this->baseUrl . $path, str_replace('+', '%20', http_build_query($params)), null, null, null, $this->proxy); $response = mb_convert_encoding($response['body'], 'UTF-8', 'GBK'); $arr = json_decode($response, true); if ($arr) { diff --git a/app/lib/dns/namesilo.php b/app/lib/dns/namesilo.php index b5ae946..4450980 100644 --- a/app/lib/dns/namesilo.php +++ b/app/lib/dns/namesilo.php @@ -197,7 +197,7 @@ class namesilo implements DnsInterface $url .= '?' . http_build_query($params); try{ - $response = curl_client($url, null, null, null, null, $this->proxy); + $response = http_request($url, null, null, null, null, $this->proxy); }catch(Exception $e){ $this->setError($e->getMessage()); return false; diff --git a/app/lib/dns/powerdns.php b/app/lib/dns/powerdns.php index d03813e..78913ae 100644 --- a/app/lib/dns/powerdns.php +++ b/app/lib/dns/powerdns.php @@ -380,7 +380,7 @@ class powerdns implements DnsInterface $headers['Content-Type'] = 'application/json'; } try { - $response = curl_client($url, $body, null, null, $headers, $this->proxy, $method); + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); } catch (Exception $e) { $this->setError($e->getMessage()); return false; diff --git a/app/lib/dns/west.php b/app/lib/dns/west.php index f2c139d..ea0e323 100644 --- a/app/lib/dns/west.php +++ b/app/lib/dns/west.php @@ -182,7 +182,7 @@ class west implements DnsInterface $params['time'] = getMillisecond(); $params['token'] = md5($this->username.$this->api_password.$params['time']); try{ - $response = curl_client($this->baseUrl . $path, http_build_query($params), null, null, null, $this->proxy); + $response = http_request($this->baseUrl . $path, http_build_query($params), null, null, null, $this->proxy); }catch(\Exception $e){ $this->setError($e->getMessage()); return false;