From 018a384828be7e84ec1826889108d9ff88eaf056 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 4 Feb 2025 17:23:00 +0100 Subject: [PATCH] pass CURLOPT_INFILESIZE_LARGE only when supported --- src/Symfony/Component/HttpClient/CurlHttpClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpClient/CurlHttpClient.php b/src/Symfony/Component/HttpClient/CurlHttpClient.php index 15b8d1499fb00..31eca9d836f21 100644 --- a/src/Symfony/Component/HttpClient/CurlHttpClient.php +++ b/src/Symfony/Component/HttpClient/CurlHttpClient.php @@ -316,8 +316,8 @@ public function request(string $method, string $url, array $options = []): Respo } foreach ($curlopts as $opt => $value) { - if (\CURLOPT_INFILESIZE === $opt && $value >= 1 << 31) { - $opt = 115; // 115 === CURLOPT_INFILESIZE_LARGE, but it's not defined in PHP + if (\PHP_INT_SIZE === 8 && \defined('CURLOPT_INFILESIZE_LARGE') && \CURLOPT_INFILESIZE === $opt && $value >= 1 << 31) { + $opt = \CURLOPT_INFILESIZE_LARGE; } if (null !== $value && !curl_setopt($ch, $opt, $value) && \CURLOPT_CERTINFO !== $opt && (!\defined('CURLOPT_HEADEROPT') || \CURLOPT_HEADEROPT !== $opt)) { $constantName = $this->findConstantName($opt);