]> git.mxchange.org Git - friendica.git/commitdiff
Update src/Network/GuzzleResponse.php
authorPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:48:23 +0000 (19:48 +0200)
committerPhilipp <admin@philipp.info>
Fri, 20 Aug 2021 17:58:42 +0000 (19:58 +0200)
src/Network/GuzzleResponse.php

index 18155d1d292901cf2ac2fea194086cdccd3d8fa6..b1bbaa96536dd9b091ccf3cbb1a66f2d5bb6f45a 100644 (file)
@@ -89,12 +89,7 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface
        public function getContentType()
        {
                $contentTypes = $this->getHeader('Content-Type') ?? [];
-               $countTypes = count($contentTypes);
-               if ($countTypes > 0) {
-                       return $contentTypes[$countTypes - 1];
-               } else {
-                       return '';
-               }
+               return array_pop($contentTypes) ?? '';
        }
 
        /** {@inheritDoc} */