X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FModel%2FProfile.php;h=39a89694a891c911a9a6c433bc12a224d7fe2d39;hb=d71281e45b6398119ecb09d47dd8947c9e41d15b;hp=a2e374e51bdba73c9da6917dee2b26804ed360ba;hpb=93daf7883e98d797759fb81dbf12e9e368debf61;p=friendica.git diff --git a/src/Model/Profile.php b/src/Model/Profile.php index a2e374e51b..39a89694a8 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -496,7 +496,7 @@ class Profile $p['photo'] = proxy_url($p['photo'], false, PROXY_SIZE_SMALL); } - $p['url'] = self::magicLink($p['url']); + $p['url'] = Contact::magicLink($p['url']); $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, [ @@ -594,12 +594,8 @@ class Profile $cids[] = $rr['cid']; $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); - $url = $rr['url']; - if ($rr['network'] === NETWORK_DFRN) { - $url = System::baseUrl() . '/redir/' . $rr['cid']; - } - $rr['link'] = $url; + $rr['link'] = Contact::magicLink($rr['url']); $rr['title'] = $rr['name']; $rr['date'] = day_translate(DateTimeFormat::convert($rr['start'], $a->timezone, 'UTC', $rr['adjust'] ? $bd_format : $bd_short)) . (($today) ? ' ' . L10n::t('[today]') : ''); $rr['startime'] = null; @@ -1003,29 +999,6 @@ class Profile } } - /** - * @brief Returns a magic link to authenticate remote visitors - * - * @param string $contact_url The address of the contact profile - * @param integer $uid The user id, "local_user" is the default - * - * @return string with "redir" link - */ - public static function magicLink($contact_url, $uid = -1) - { - if ($uid == -1) { - $uid = local_user(); - } - $condition = ['pending' => false, 'uid' => $uid, - 'nurl' => normalise_link($contact_url), - 'network' => NETWORK_DFRN, 'self' => false]; - $contact = dba::selectFirst('contact', ['id'], $condition); - if (DBM::is_result($contact)) { - return System::baseUrl() . '/redir/' . $contact['id']; - } - return self::zrl($contact_url); - } - public static function zrl($s, $force = false) { if (!strlen($s)) {