X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FPhoto.php;h=0f03b54b0dbac9677dfaca7ee2cb48a6211f5e76;hb=c3d0ab56a560809f0d331f3f45f1f213a2094358;hp=6380f42789d734bf0f454457e670565fb6a65681;hpb=8318a0b6407a1e76ebe09f3cd9a4349382235319;p=friendica.git diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 6380f42789..0f03b54b0d 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -32,6 +32,7 @@ use Friendica\Object\Image; use Friendica\Util\DateTimeFormat; use Friendica\Util\Images; use Friendica\Security\Security; +use Friendica\Util\Proxy; use Friendica\Util\Strings; require_once "include/dba.php"; @@ -422,7 +423,7 @@ class Photo $filename = basename($image_url); if (!empty($image_url)) { - $ret = DI::httpRequest()->get($image_url, true); + $ret = DI::httpRequest()->get($image_url); $img_str = $ret->getBody(); $type = $ret->getContentType(); } else { @@ -494,9 +495,10 @@ class Photo } if ($photo_failure) { - $image_url = DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO; - $thumb = DI::baseUrl() . Contact::DEFAULT_AVATAR_THUMB; - $micro = DI::baseUrl() . Contact::DEFAULT_AVATAR_MICRO; + $contact = Contact::getById($cid) ?: []; + $image_url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL); + $thumb = Contact::getDefaultAvatar($contact, Proxy::SIZE_THUMB); + $micro = Contact::getDefaultAvatar($contact, Proxy::SIZE_MICRO); } return [$image_url, $thumb, $micro];