]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Issue 9584: Only search posts from federated networks
[friendica.git] / src / Model / Photo.php
index 6380f42789d734bf0f454457e670565fb6a65681..0f03b54b0dbac9677dfaca7ee2cb48a6211f5e76 100644 (file)
@@ -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];