From 8d87fe6fa137deb432b33597770c425966a9a6ec Mon Sep 17 00:00:00 2001 From: zhangxuejiang Date: Tue, 3 Sep 2024 10:53:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20php8=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20=EF=BC=88cherry=20picked=20commit=20from?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/RequestCore.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/RequestCore.class.php b/lib/RequestCore.class.php index a98c97c..1627321 100644 --- a/lib/RequestCore.class.php +++ b/lib/RequestCore.class.php @@ -766,8 +766,18 @@ class RequestCore $this->response = $response; } - // As long as this came back as a valid resource... - if (is_resource($this->curl_handle)) + $handleResponse = false; + // @link https://www.php.net/manual/en/function.curl-init.php#refsect1-function.curl-init-changelog + if (version_compare(PHP_VERSION, '8.0.0', '>=')) { + if (get_class($this->curl_handle) == 'CurlHandle') { + $handleResponse = true; + } + } else { + if (is_resource($this->curl_handle)) { + $handleResponse = true; + } + } + if ($handleResponse) { // Determine what's what. $header_size = curl_getinfo($this->curl_handle, CURLINFO_HEADER_SIZE); -- Gitee