From 6d3949d54af9ad09c4308c7032a91bd76a24fd1c Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 15 Jul 2020 17:29:52 +0000 Subject: [PATCH] Changed default value --- mod/common.php | 2 +- mod/display.php | 2 +- mod/suggest.php | 2 +- src/Core/Search.php | 6 +++--- src/Model/Contact.php | 2 +- src/Model/GContact.php | 2 +- src/Module/AllFriends.php | 2 +- src/Module/Contact/Hovercard.php | 2 +- src/Module/Profile/Contacts.php | 2 +- src/Protocol/DFRN.php | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mod/common.php b/mod/common.php index 9b327f1bf..9231d090b 100644 --- a/mod/common.php +++ b/mod/common.php @@ -124,7 +124,7 @@ function common_content(App $a) $entries = []; foreach ($common_friends as $common_friend) { //get further details of the contact - $contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid, false); + $contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid); // $rr['id'] is needed to use contact_photo_menu() /// @TODO Adding '/" here avoids E_NOTICE on missing constants diff --git a/mod/display.php b/mod/display.php index ddc78d6ea..61e1529e4 100644 --- a/mod/display.php +++ b/mod/display.php @@ -164,7 +164,7 @@ function display_fetchauthor($a, $item) $profiledata["about"] = ""; } - $profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user(), false)); + $profiledata = array_merge($profiledata, Contact::getByURLForUser($profiledata["url"], local_user())); if (!empty($profiledata["photo"])) { $profiledata["photo"] = DI::baseUrl()->remove($profiledata["photo"]); diff --git a/mod/suggest.php b/mod/suggest.php index 2b7b1f674..068b9e366 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -104,7 +104,7 @@ function suggest_content(App $a) 'hide' => [DI::l10n()->t('Ignore/Hide'), $ignlnk] ]; - $contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user(), false)); + $contact_details = array_merge($rr, Contact::getByURLForUser($rr["url"], local_user())); $entry = [ 'url' => Contact::magicLink($rr['url']), diff --git a/src/Core/Search.php b/src/Core/Search.php index 208633272..d6ed9b6bf 100644 --- a/src/Core/Search.php +++ b/src/Core/Search.php @@ -77,7 +77,7 @@ class Search // Ensure that we do have a contact entry Contact::getIdForURL($user_data['url'] ?? ''); - $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user(), false); + $contactDetails = Contact::getByURLForUser($user_data['url'] ?? '', local_user()); $result = new ContactResult( $user_data['name'] ?? '', @@ -143,7 +143,7 @@ class Search foreach ($profiles as $profile) { $profile_url = $profile['url'] ?? ''; - $contactDetails = Contact::getByURLForUser($profile_url, local_user(), false); + $contactDetails = Contact::getByURLForUser($profile_url, local_user()); $result = new ContactResult( $profile['name'] ?? '', @@ -232,7 +232,7 @@ class Search continue; } - $contact = Contact::getByURLForUser($row["nurl"], local_user(), false); + $contact = Contact::getByURLForUser($row["nurl"], local_user()); if ($contact["name"] == "") { $contact["name"] = end(explode("/", $urlParts["path"])); diff --git a/src/Model/Contact.php b/src/Model/Contact.php index afec92007..15e4e5703 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -238,7 +238,7 @@ class Contact * @param boolean $update true = always update, false = never update, null = update when not found or outdated * @return array contact array */ - public static function getByURLForUser(string $url, int $uid = 0, $update = null, array $fields = []) + public static function getByURLForUser(string $url, int $uid = 0, $update = false, array $fields = []) { if ($uid != 0) { $contact = self::getByURL($url, $update, $fields, $uid); diff --git a/src/Model/GContact.php b/src/Model/GContact.php index e8cd4768a..5ef74dcf7 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -111,7 +111,7 @@ class GContact continue; } - $gcontacts[] = Contact::getByURLForUser($result['nurl'], local_user(), false); + $gcontacts[] = Contact::getByURLForUser($result['nurl'], local_user()); } DBA::close($results); return $gcontacts; diff --git a/src/Module/AllFriends.php b/src/Module/AllFriends.php index d2d2b3b0c..293293062 100644 --- a/src/Module/AllFriends.php +++ b/src/Module/AllFriends.php @@ -79,7 +79,7 @@ class AllFriends extends BaseModule $entries = []; foreach ($friends as $friend) { //get further details of the contact - $contactDetails = array_merge($friend, Model\Contact::getByURLForUser($friend['url'], $uid, false)); + $contactDetails = array_merge($friend, Model\Contact::getByURLForUser($friend['url'], $uid)); $connlnk = ''; // $friend[cid] is only available for common contacts. So if the contact is a common one, use contact_photo_menu to generate the photoMenu diff --git a/src/Module/Contact/Hovercard.php b/src/Module/Contact/Hovercard.php index 29329b229..750b856bc 100644 --- a/src/Module/Contact/Hovercard.php +++ b/src/Module/Contact/Hovercard.php @@ -65,7 +65,7 @@ class Hovercard extends BaseModule // Search for contact data // Look if the local user has got the contact if (Session::isAuthenticated()) { - $contact = Contact::getByURLForUser($contact_url, local_user(), false); + $contact = Contact::getByURLForUser($contact_url, local_user()); } else { $contact = Contact::getByURL($contact_url, false); } diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 60ba2b92e..508fe3762 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -103,7 +103,7 @@ class Contacts extends BaseProfile continue; } - $contact_details = array_merge($contact, Contact::getByURLForUser($contact['url'], $a->profile['uid'], false)); + $contact_details = array_merge($contact, Contact::getByURLForUser($contact['url'], $a->profile['uid'])); $contacts[] = [ 'id' => $contact['id'], diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index c9a76fef0..b7c3204b7 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -755,7 +755,7 @@ class DFRN { $author = $doc->createElement($element); - $contact = Contact::getByURLForUser($contact_url, $item["uid"], null, ['url', 'name', 'addr', 'photo']); + $contact = Contact::getByURLForUser($contact_url, $item["uid"], false, ['url', 'name', 'addr', 'photo']); if (!empty($contact)) { XML::addElement($doc, $author, "name", $contact["name"]); XML::addElement($doc, $author, "uri", $contact["url"]);