From 3a63ac819031c0963b9f04444d2174d050750229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Mari=C4=87?= Date: Wed, 10 Dec 2025 11:54:24 +0100 Subject: [PATCH 1/2] docs(changelog): add missing changes to `1.6.4` --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ad87373..7a0c177 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ ## 1.6.4 * Will use POST instead of GET when retrieving result. +* Remove deprecated `curl_close` for PHP version 8. https://www.php.net/manual/en/function.curl-close.php. +* Support PHP `8.5`. ## 1.6.3 * Add minimum TLS 1.2 version to curl options as protocol negotiation on certain openssl/libcurl versions is flaky. From 793f728199c0a3d64d3e7d9e88771378a35c84d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Mari=C4=87?= Date: Wed, 10 Dec 2025 12:14:08 +0100 Subject: [PATCH 2/2] fix(client): explicitly unset connection handler to free connection when PHP>8.5 --- lib/Tinify/Client.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Tinify/Client.php b/lib/Tinify/Client.php index 93bd513..0d8ed0c 100644 --- a/lib/Tinify/Client.php +++ b/lib/Tinify/Client.php @@ -114,6 +114,8 @@ function request($method, $url, $body = NULL) { $headerSize = curl_getinfo($request, CURLINFO_HEADER_SIZE); if (PHP_VERSION_ID < 80000) { curl_close($request); + } else { + unset($request); } $headers = self::parseHeaders(substr($response, 0, $headerSize)); @@ -144,6 +146,8 @@ function request($method, $url, $body = NULL) { $message = sprintf("%s (#%d)", curl_error($request), curl_errno($request)); if (PHP_VERSION_ID < 80000) { curl_close($request); + } else { + unset($request); } if ($retries > 0) continue; throw new ConnectionException("Error while connecting: " . $message);