From d94c18cf99554c6c57743be63dd117533ff2edae Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Tue, 16 Jan 2024 22:55:28 +0700 Subject: [PATCH] [PHP 8.4] Fix: Curl `CURLOPT_BINARYTRANSFER` deprecated The `CURLOPT_BINARYTRANSFER` PHP constant from the Curl extension was no-op since PHP 5.1, and is deprecated in PHP 8.4. This removes the constant usage to avoid the deprecation notice in PHP 8.4 and later. Because this constant was no-op since PHP 5.1 (circa 2005), this change has no impact. See: - [PHP.Watch - PHP 8.4 - Curl: CURLOPT_BINARYTRANSFER deprecated](https://php.watch/versions/8.4/CURLOPT_BINARYTRANSFER-deprecated) - [commit](https://github.com/php/php-src/commit/fc16285538e96ecb35d017231051f83dcbd8b55b) --- .../classes/blogImportPluginWebasystRemoteTransport.class.php | 1 - wa-installer/lib/classes/wainstaller.class.php | 1 - wa-plugins/payment/qiwi/lib/qiwiPayment.class.php | 1 - wa-system/file/waFiles.class.php | 1 - 4 files changed, 4 deletions(-) diff --git a/wa-apps/blog/plugins/import/lib/classes/blogImportPluginWebasystRemoteTransport.class.php b/wa-apps/blog/plugins/import/lib/classes/blogImportPluginWebasystRemoteTransport.class.php index ca57c588d..fea1b37ef 100644 --- a/wa-apps/blog/plugins/import/lib/classes/blogImportPluginWebasystRemoteTransport.class.php +++ b/wa-apps/blog/plugins/import/lib/classes/blogImportPluginWebasystRemoteTransport.class.php @@ -210,7 +210,6 @@ private function getCurl($url, $curl_options = array()) CURLOPT_RETURNTRANSFER => 1, CURLOPT_TIMEOUT => self::TIMEOUT_SOCKET * 60, CURLOPT_CONNECTTIMEOUT => self::TIMEOUT_SOCKET, - CURLOPT_BINARYTRANSFER => true, CURLOPT_WRITEFUNCTION => array(&$this, 'curlWriteHandler'), CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderHandler'), ); diff --git a/wa-installer/lib/classes/wainstaller.class.php b/wa-installer/lib/classes/wainstaller.class.php index c5010ed7f..1a6f50919 100644 --- a/wa-installer/lib/classes/wainstaller.class.php +++ b/wa-installer/lib/classes/wainstaller.class.php @@ -1846,7 +1846,6 @@ private function getCurl($url, $curl_options = array()) CURLOPT_TIMEOUT => self::TIMEOUT_SOCKET * 60, CURLOPT_CONNECTTIMEOUT => self::TIMEOUT_SOCKET, CURLOPT_DNS_CACHE_TIMEOUT => 3600, - CURLOPT_BINARYTRANSFER => true, CURLOPT_WRITEFUNCTION => array(&$this, 'curlWriteHandler'), CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderHandler'), ); diff --git a/wa-plugins/payment/qiwi/lib/qiwiPayment.class.php b/wa-plugins/payment/qiwi/lib/qiwiPayment.class.php index d43fde746..7085b81f5 100644 --- a/wa-plugins/payment/qiwi/lib/qiwiPayment.class.php +++ b/wa-plugins/payment/qiwi/lib/qiwiPayment.class.php @@ -665,7 +665,6 @@ private function restQuery($params, $data = array()) @curl_setopt($ch, CURLOPT_USERPWD, "{$login}:{$this->password}"); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - @curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); if ($query) { diff --git a/wa-system/file/waFiles.class.php b/wa-system/file/waFiles.class.php index cf4a2199d..ad971eef5 100644 --- a/wa-system/file/waFiles.class.php +++ b/wa-system/file/waFiles.class.php @@ -445,7 +445,6 @@ private static function curlInit($url, $options) CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 10, CURLOPT_DNS_CACHE_TIMEOUT => 3600, - CURLOPT_BINARYTRANSFER => true, CURLOPT_WRITEFUNCTION => array(__CLASS__, 'curlWriteHandler'), );