From ef06fab744f1b33908b89672288ce3d5a50cf8ce Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 11 Oct 2020 23:24:40 +0200 Subject: [PATCH] Revert "Update src/Network/GuzzleResponse.php" This reverts commit 79e667b3 --- src/Network/GuzzleResponse.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Network/GuzzleResponse.php b/src/Network/GuzzleResponse.php index b1bbaa9653..18155d1d29 100644 --- a/src/Network/GuzzleResponse.php +++ b/src/Network/GuzzleResponse.php @@ -89,7 +89,12 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface public function getContentType() { $contentTypes = $this->getHeader('Content-Type') ?? []; - return array_pop($contentTypes) ?? ''; + $countTypes = count($contentTypes); + if ($countTypes > 0) { + return $contentTypes[$countTypes - 1]; + } else { + return ''; + } } /** {@inheritDoc} */