From: gggeek Date: Fri, 25 Nov 2022 11:05:28 +0000 (+0000) Subject: fix php 8 warning when req has no content-type header X-Git-Tag: 4.9.0~21 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=efebc9f1d4decc20eae375a26b464313480ed68a;p=plcapi.git fix php 8 warning when req has no content-type header --- 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, '