Use a default value for "uid"

This commit is contained in:
Michael 2021-06-28 13:58:06 +00:00
parent a1a584f444
commit 2f06d271bb
2 changed files with 4 additions and 4 deletions

View File

@ -274,7 +274,7 @@ class Photo
* @return array * @return array
* @throws \Exception * @throws \Exception
*/ */
public static function createPhotoForExternalResource($url, $uid, $mimetype = "image/jpeg") public static function createPhotoForExternalResource($url, $uid = 0, $mimetype = "image/jpeg")
{ {
$fields = self::getFields(); $fields = self::getFields();
$values = array_fill(0, count($fields), ""); $values = array_fill(0, count($fields), "");

View File

@ -201,7 +201,7 @@ class Photo extends BaseModule
} else { } else {
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL); $url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL);
} }
return MPhoto::createPhotoForExternalResource($url, 0); return MPhoto::createPhotoForExternalResource($url);
case "header": case "header":
$contact = Contact::getById($uid, ['uid', 'url', 'header']); $contact = Contact::getById($uid, ['uid', 'url', 'header']);
if (empty($contact)) { if (empty($contact)) {
@ -215,7 +215,7 @@ class Photo extends BaseModule
} else { } else {
$url = DI::baseUrl() . '/images/blank.png'; $url = DI::baseUrl() . '/images/blank.png';
} }
return MPhoto::createPhotoForExternalResource($url, 0); return MPhoto::createPhotoForExternalResource($url);
case "profile": case "profile":
case "custom": case "custom":
$scale = 4; $scale = 4;
@ -247,7 +247,7 @@ class Photo extends BaseModule
$parts = parse_url($default); $parts = parse_url($default);
if (!empty($parts['scheme']) || !empty($parts['host'])) { if (!empty($parts['scheme']) || !empty($parts['host'])) {
$photo = MPhoto::createPhotoForExternalResource($default, 0); $photo = MPhoto::createPhotoForExternalResource($default);
} else { } else {
$photo = MPhoto::createPhotoForSystemResource($default); $photo = MPhoto::createPhotoForSystemResource($default);
} }