mirror of
https://github.com/friendica/friendica
synced 2025-04-22 04:30:10 +00:00
New class for external resources
This commit is contained in:
parent
96809b3fdd
commit
9276f6823b
5 changed files with 134 additions and 15 deletions
|
@ -167,7 +167,7 @@ class Photo extends BaseModule
|
|||
} else {
|
||||
$url = DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO;
|
||||
}
|
||||
return MPhoto::createPhotoForSystemResource($url);
|
||||
return MPhoto::createPhotoForExternalResource($url);
|
||||
case "header":
|
||||
$contact = Contact::getById($uid, ['uid', 'url', 'header']);
|
||||
if (empty($contact)) {
|
||||
|
@ -181,7 +181,7 @@ class Photo extends BaseModule
|
|||
} else {
|
||||
$url = DI::baseUrl() . '/images/blank.png';
|
||||
}
|
||||
return MPhoto::createPhotoForSystemResource($url);
|
||||
return MPhoto::createPhotoForExternalResource($url);
|
||||
case "profile":
|
||||
case "custom":
|
||||
$scale = 4;
|
||||
|
@ -211,7 +211,12 @@ class Photo extends BaseModule
|
|||
$default = Contact::getDefaultAvatar($contact, Proxy::SIZE_THUMB);
|
||||
}
|
||||
|
||||
$photo = MPhoto::createPhotoForSystemResource($default);
|
||||
$parts = parse_url($default);
|
||||
if (!empty($parts['scheme']) || !empty($parts['host'])) {
|
||||
$photo = MPhoto::createPhotoForExternalResource($default);
|
||||
} else {
|
||||
$photo = MPhoto::createPhotoForSystemResource($default);
|
||||
}
|
||||
}
|
||||
return $photo;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue