From 1210e235fbb7e1a4d708ae3b2cc406fe89ff5448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Fri, 29 Jul 2022 17:19:07 +0200 Subject: [PATCH] Extracted as variable to have 2 more array fields moved to array initialization. --- src/Model/Contact.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 01ef3d664e..2c1ca2d4ce 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -703,6 +703,7 @@ class Contact } $file_suffix = 'jpg'; + $url = DI::baseUrl() . '/profile/' . $user['nickname']; $fields = [ 'name' => $profile['name'], @@ -717,7 +718,10 @@ class Contact 'xmpp' => $profile['xmpp'], 'matrix' => $profile['matrix'], 'network' => Protocol::DFRN, - 'url' => DI::baseUrl() . '/profile/' . $user['nickname'], + 'url' => $url, + // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine. + 'nurl' => Strings::normaliseLink($url), + 'uri-id' => ItemURI::getIdByURI($url), 'addr' => $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3), 'request' => DI::baseUrl() . '/dfrn_request/' . $user['nickname'], 'notify' => DI::baseUrl() . '/dfrn_notify/' . $user['nickname'], @@ -726,9 +730,6 @@ class Contact 'poco' => DI::baseUrl() . '/poco/' . $user['nickname'], ]; - // it seems as if ported accounts can have wrong values, so we make sure that now everything is fine. - $fields['nurl'] = Strings::normaliseLink($fields['url']); - $fields['uri-id'] = ItemURI::getIdByURI($fields['url']); $avatar = Photo::selectFirst(['resource-id', 'type'], ['uid' => $uid, 'profile' => true]); if (DBA::isResult($avatar)) {