]> git.mxchange.org Git - friendica.git/commitdiff
Fixed:
authorRoland Häder <roland@mxchange.org>
Tue, 21 Jun 2022 16:54:21 +0000 (18:54 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 27 Jun 2022 13:16:16 +0000 (15:16 +0200)
- "Argument 3 passed to Friendica\Model\Photo::createPhotoForExternalResource()
  must be of the type string, null given

src/Module/Photo.php

index 341858259fbe322ce6f9b719fa02499eceefc489..d1b4b9629e8608ff7a1413aa851be76aacf537d0 100644 (file)
@@ -258,7 +258,7 @@ class Photo extends BaseModule
                                        return MPhoto::getPhoto($matches[1], $matches[2]);
                                }
 
-                               return MPhoto::createPhotoForExternalResource($url, (int)local_user(), $media['mimetype']);
+                               return MPhoto::createPhotoForExternalResource($url, (int)local_user(), $media['mimetype'] ?? '');
                        case 'media':
                                $media = DBA::selectFirst('post-media', ['url', 'mimetype', 'uri-id'], ['id' => $id, 'type' => Post\Media::IMAGE]);
                                if (empty($media)) {
@@ -276,7 +276,7 @@ class Photo extends BaseModule
                                        return false;
                                }
 
-                               return MPhoto::createPhotoForExternalResource($link['url'], (int)local_user(), $link['mimetype']);
+                               return MPhoto::createPhotoForExternalResource($link['url'], (int)local_user(), $link['mimetype'] ?? '');
                        case 'contact':
                                $fields = ['uid', 'uri-id', 'url', 'nurl', 'avatar', 'photo', 'xmpp', 'addr', 'network', 'failed', 'updated'];
                                $contact = Contact::getById($id, $fields);