diff options
| author | 2026-01-03 18:43:15 +0100 | |
|---|---|---|
| committer | 2026-01-03 18:43:15 +0100 | |
| commit | b07ec816b023c911f76c4149d00a2ffbdcab1d16 (patch) | |
| tree | 0c1f2835fbe159280608dd0479fbedb7f3e71dc4 /lib/simplepie | |
| parent | 26c1102567c095b051b5e1a0aedb45b78713c283 (diff) | |
Switch to using CURLOPT_ACCEPT_ENCODING instead of the deprecated CURLOPT_ENCODING (#8376)
* Replace deprecated CURLOPT_ENCODING
The CURLOPT_ENCODING setting has been deprecated in favor of
CURLOPT_ACCEPT_ENCODING.
Signed-off-by: Michael Meier <mmeier1986@gmail.com>
* Sync with our SimplePie fork PR
https://github.com/FreshRSS/simplepie/pull/67
https://github.com/simplepie/simplepie/pull/960
https://github.com/simplepie/simplepie/pull/962
* Our SimplePie PR merged
---------
Signed-off-by: Michael Meier <mmeier1986@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'lib/simplepie')
| -rw-r--r-- | lib/simplepie/simplepie/src/File.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/simplepie/simplepie/src/File.php b/lib/simplepie/simplepie/src/File.php index 0981ebf96..a5396e576 100644 --- a/lib/simplepie/simplepie/src/File.php +++ b/lib/simplepie/simplepie/src/File.php @@ -121,7 +121,9 @@ class File implements Response } unset($curl_options[CURLOPT_HTTPHEADER]); } - if (version_compare(\SimplePie\Misc::get_curl_version(), '7.10.5', '>=')) { + if (version_compare(\SimplePie\Misc::get_curl_version(), '7.21.6', '>=')) { + curl_setopt($fp, CURLOPT_ACCEPT_ENCODING, ''); + } elseif (version_compare(\SimplePie\Misc::get_curl_version(), '7.10.5', '>=')) { curl_setopt($fp, CURLOPT_ENCODING, ''); } curl_setopt($fp, CURLOPT_URL, $url); @@ -147,7 +149,11 @@ class File implements Response $this->error = 'cURL error ' . curl_errno($fp) . ': ' . curl_error($fp); // FreshRSS $this->on_http_response($responseBody === false ? false : $responseHeaders . $responseBody, $curl_options); $this->error = null; // FreshRSS - curl_setopt($fp, CURLOPT_ENCODING, 'none'); + if (version_compare(\SimplePie\Misc::get_curl_version(), '7.21.6', '>=')) { + curl_setopt($fp, CURLOPT_ACCEPT_ENCODING, null); + } else { + curl_setopt($fp, CURLOPT_ENCODING, null); + } $responseHeaders = ''; $responseBody = curl_exec($fp); $responseHeaders .= "\r\n"; |
