]> git.mxchange.org Git - friendica.git/commitdiff
Use last entry for Content-Type
authorPhilipp <admin@philipp.info>
Sat, 10 Oct 2020 21:10:35 +0000 (23:10 +0200)
committerPhilipp <admin@philipp.info>
Sat, 10 Oct 2020 21:11:30 +0000 (23:11 +0200)
src/Network/GuzzleResponse.php
src/Util/Images.php

index 72d87ae9fe94d1ec8145391fd0322efe999d0639..18155d1d292901cf2ac2fea194086cdccd3d8fa6 100644 (file)
@@ -88,7 +88,13 @@ class GuzzleResponse extends Response implements IHTTPResult, ResponseInterface
        /** {@inheritDoc} */
        public function getContentType()
        {
-               return implode($this->getHeader('Content-Type'));
+               $contentTypes = $this->getHeader('Content-Type') ?? [];
+               $countTypes = count($contentTypes);
+               if ($countTypes > 0) {
+                       return $contentTypes[$countTypes - 1];
+               } else {
+                       return '';
+               }
        }
 
        /** {@inheritDoc} */
index e0375da3d752d4c5599fc77b6640d1185afefc08..1b52b91a133e62b359cc3cecd0e8ddcde2034565 100644 (file)
@@ -77,7 +77,7 @@ class Images
         *
         * @param string $image_data Image data
         * @param string $filename   File name (for guessing the type via the extension)
-        * @param string $mimeTypes  possible mime type
+        * @param string $mimeType   possible mime type
         *
         * @return string
         * @throws \Exception