From efebc9f1d4decc20eae375a26b464313480ed68a Mon Sep 17 00:00:00 2001 From: gggeek Date: Fri, 25 Nov 2022 11:05:28 +0000 Subject: [PATCH] fix php 8 warning when req has no content-type header --- src/Request.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Request.php b/src/Request.php index 5af3e418..e3560081 100644 --- a/src/Request.php +++ b/src/Request.php @@ -279,7 +279,10 @@ class Request } // try to 'guestimate' the character encoding of the received response - $respEncoding = XMLParser::guessEncoding(@$this->httpResponse['headers']['content-type'], $data); + $respEncoding = XMLParser::guessEncoding( + isset($this->httpResponse['headers']['content-type']) ? $this->httpResponse['headers']['content-type'] : '', + $data + ); if ($this->debug) { $start = strpos($data, '