Merge pull request #5079 from annando/fix-self

Fix: Sometimes the contact endpoints seem to be wrong
This commit is contained in:
Hypolite Petovan 2018-05-18 08:54:00 -04:00 committed by GitHub
commit 83ff57777f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,6 +206,16 @@ class Contact extends BaseObject
$fields['forum'] = $user['page-flags'] == PAGE_COMMUNITY; $fields['forum'] = $user['page-flags'] == PAGE_COMMUNITY;
$fields['prv'] = $user['page-flags'] == PAGE_PRVGROUP; $fields['prv'] = $user['page-flags'] == PAGE_PRVGROUP;
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
$fields['url'] = System::baseUrl() . '/profile/' . $user['nickname'];
$fields['nurl'] = normalise_link($fields['url']);
$fields['addr'] = $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
$fields['request'] = System::baseUrl() . '/dfrn_request/' . $user['nickname'];
$fields['notify'] = System::baseUrl() . '/dfrn_notify/' . $user['nickname'];
$fields['poll'] = System::baseUrl() . '/dfrn_poll/' . $user['nickname'];
$fields['confirm'] = System::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
$fields['poco'] = System::baseUrl() . '/poco/' . $user['nickname'];
$update = false; $update = false;
foreach ($fields as $field => $content) { foreach ($fields as $field => $content) {