Skip to content

Commit e2162c1

Browse files
authored
Bugfix: Empty Encoding causes Write Error (#83)
Passing an empty string for the cURL option CURLOPT_ENCODING causes a write error due to a 0-length write in the underlying libcurl, starting in PHP 8.3.7.
1 parent c82acc4 commit e2162c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/JiraClient.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ public function exec(string $context, array|string $post_data = null, string $cu
236236
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
237237
}
238238

239-
curl_setopt($ch, CURLOPT_ENCODING, '');
239+
if (\PHP_VERSION_ID < 80307) {
240+
// See https://github.com/php/php-src/issues/14184
241+
curl_setopt($ch, CURLOPT_ENCODING, '');
242+
}
240243

241244
curl_setopt(
242245
$ch,

0 commit comments

Comments
 (0)