]> git.mxchange.org Git - friendica.git/commitdiff
Use a default value for "uid"
authorMichael <heluecht@pirati.ca>
Mon, 28 Jun 2021 13:58:06 +0000 (13:58 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Jun 2021 13:58:06 +0000 (13:58 +0000)
src/Model/Photo.php
src/Module/Photo.php

index 7de0084e2443dcdd490f8cdafdc2f82122378a1c..fe416c360f54e55d1c19c16e99867dd4a65e9ebf 100644 (file)
@@ -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), "");
index 2a7fdc5fd875390ce66385afbc0036e5f9ba25b2..f61a4564d61c79441e6b6fea4b7fa55550c9f067 100644 (file)
@@ -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);
                        }