]> git.mxchange.org Git - friendica.git/commitdiff
Revert "Update src/Network/GuzzleResponse.php"
authorPhilipp <admin@philipp.info>
Sun, 11 Oct 2020 21:24:40 +0000 (23:24 +0200)
committerPhilipp <admin@philipp.info>
Sun, 11 Oct 2020 21:24:40 +0000 (23:24 +0200)
This reverts commit 79e667b3

src/Network/GuzzleResponse.php

index b1bbaa96536dd9b091ccf3cbb1a66f2d5bb6f45a..18155d1d292901cf2ac2fea194086cdccd3d8fa6 100644 (file)
@@ -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} */