]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Photo.php
Some more API functions moved
[friendica.git] / src / Module / Photo.php
index 21e02c7cd89b1a6da9c1b18a2982be9b7e661554..399313e3f5c428816d89404b1dbc47837376343c 100644 (file)
@@ -289,13 +289,17 @@ class Photo extends BaseModule
                                $mimetext = '';
                                if (!empty($url)) {
                                        $mime = ParseUrl::getContentType($url);
-                                       if (empty($mime) || ($mime[0] != 'image')) {
-                                               $url = '';
-                                       } else {
+                                       if (!empty($mime)) {
                                                $mimetext = $mime[0] . '/' . $mime[1];
+                                       } else {
+                                               Logger::info('Invalid file', ['url' => $url]);
+                                       }
+                                       if (!empty($mimetext) && ($mime[0] != 'image') && ($mimetext != 'application/octet-stream')) {
+                                               Logger::info('Unexpected Content-Type', ['mime' => $mimetext, 'url' => $url]);
+                                               $mimetext = '';
                                        }
                                }
-                               if (empty($url)) {
+                               if (empty($mimetext)) {
                                        if ($customsize <= Proxy::PIXEL_MICRO) {
                                                $url = Contact::getDefaultAvatar($contact, Proxy::SIZE_MICRO);
                                        } elseif ($customsize <= Proxy::PIXEL_THUMB) {