diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 8a8c304361..2a7fdc5fd8 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -171,7 +171,7 @@ class Photo extends BaseModule $author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]); $url = Contact::magicLinkByContact($author, $url); - return MPhoto::createPhotoForExternalResource($url, local_user()); + return MPhoto::createPhotoForExternalResource($url, (int)local_user()); case "media": $media = DBA::selectFirst('post-media', ['url', 'uri-id'], ['id' => $uid, 'type' => Post\Media::IMAGE]); if (empty($media)) { @@ -181,7 +181,7 @@ class Photo extends BaseModule $author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]); $url = Contact::magicLinkByContact($author, $media['url']); - return MPhoto::createPhotoForExternalResource($url, local_user()); + return MPhoto::createPhotoForExternalResource($url, (int)local_user()); case "contact": $contact = Contact::getById($uid, ['uid', 'url', 'avatar', 'photo', 'xmpp', 'addr']); if (empty($contact)) { @@ -201,7 +201,7 @@ class Photo extends BaseModule } else { $url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL); } - return MPhoto::createPhotoForExternalResource($url, local_user()); + return MPhoto::createPhotoForExternalResource($url, 0); case "header": $contact = Contact::getById($uid, ['uid', 'url', 'header']); if (empty($contact)) { @@ -215,7 +215,7 @@ class Photo extends BaseModule } else { $url = DI::baseUrl() . '/images/blank.png'; } - return MPhoto::createPhotoForExternalResource($url, local_user()); + return MPhoto::createPhotoForExternalResource($url, 0); case "profile": case "custom": $scale = 4; @@ -247,7 +247,7 @@ class Photo extends BaseModule $parts = parse_url($default); if (!empty($parts['scheme']) || !empty($parts['host'])) { - $photo = MPhoto::createPhotoForExternalResource($default, local_user()); + $photo = MPhoto::createPhotoForExternalResource($default, 0); } else { $photo = MPhoto::createPhotoForSystemResource($default); }