From 2f06d271bb4380cacd95d9f17ecf65dfc7faffcb Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Jun 2021 13:58:06 +0000 Subject: [PATCH] Use a default value for "uid" --- src/Model/Photo.php | 2 +- src/Module/Photo.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 7de0084e24..fe416c360f 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -274,7 +274,7 @@ class Photo * @return array * @throws \Exception */ - public static function createPhotoForExternalResource($url, $uid, $mimetype = "image/jpeg") + public static function createPhotoForExternalResource($url, $uid = 0, $mimetype = "image/jpeg") { $fields = self::getFields(); $values = array_fill(0, count($fields), ""); diff --git a/src/Module/Photo.php b/src/Module/Photo.php index 2a7fdc5fd8..f61a4564d6 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -201,7 +201,7 @@ class Photo extends BaseModule } else { $url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL); } - return MPhoto::createPhotoForExternalResource($url, 0); + return MPhoto::createPhotoForExternalResource($url); 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, 0); + return MPhoto::createPhotoForExternalResource($url); 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, 0); + $photo = MPhoto::createPhotoForExternalResource($default); } else { $photo = MPhoto::createPhotoForSystemResource($default); }