From b171d5531d84b10dbd4eec3f5c664924e3702cad Mon Sep 17 00:00:00 2001 From: Zan Baldwin Date: Wed, 11 May 2022 19:17:58 +0200 Subject: [PATCH] CurlDownloader: Always cast Content-Type header value to string when passing to strtolower() (#10768) --- src/Composer/Util/Http/CurlDownloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/Http/CurlDownloader.php b/src/Composer/Util/Http/CurlDownloader.php index 6fe22e713..051fca277 100644 --- a/src/Composer/Util/Http/CurlDownloader.php +++ b/src/Composer/Util/Http/CurlDownloader.php @@ -626,7 +626,7 @@ class CurlDownloader } $details = ''; - if (in_array(strtolower($response->getHeader('content-type')), array('application/json', 'application/json; charset=utf-8'), true)) { + if (in_array(strtolower((string) $response->getHeader('content-type')), array('application/json', 'application/json; charset=utf-8'), true)) { $details = ':'.PHP_EOL.substr($response->getBody(), 0, 200).(strlen($response->getBody()) > 200 ? '...' : ''); }