Merge pull request #8684 from annando/baseurl
Some more "baseurl" improvements
This commit is contained in:
commit
609ae1869c
|
@ -1542,6 +1542,14 @@ class Contact
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($data['baseurl'])) {
|
||||||
|
$data['baseurl'] = GServer::cleanURL($data['baseurl']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($data['baseurl']) && empty($data['gsid'])) {
|
||||||
|
$data['gsid'] = GServer::getID($data['baseurl']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$contact_id && !empty($data['alias']) && ($data['alias'] != $url) && !$in_loop) {
|
if (!$contact_id && !empty($data['alias']) && ($data['alias'] != $url) && !$in_loop) {
|
||||||
$contact_id = self::getIdForURL($data["alias"], $uid, true, $default, true);
|
$contact_id = self::getIdForURL($data["alias"], $uid, true, $default, true);
|
||||||
}
|
}
|
||||||
|
@ -1624,7 +1632,7 @@ class Contact
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$fields = ['url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date', 'baseurl'];
|
$fields = ['url', 'nurl', 'addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'avatar-date', 'baseurl', 'gsid'];
|
||||||
$contact = DBA::selectFirst('contact', $fields, ['id' => $contact_id]);
|
$contact = DBA::selectFirst('contact', $fields, ['id' => $contact_id]);
|
||||||
|
|
||||||
// This condition should always be true
|
// This condition should always be true
|
||||||
|
@ -1638,7 +1646,7 @@ class Contact
|
||||||
'updated' => DateTimeFormat::utcNow()
|
'updated' => DateTimeFormat::utcNow()
|
||||||
];
|
];
|
||||||
|
|
||||||
$fields = ['addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'baseurl'];
|
$fields = ['addr', 'alias', 'name', 'nick', 'keywords', 'location', 'about', 'baseurl', 'gsid'];
|
||||||
|
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$updated[$field] = ($data[$field] ?? '') ?: $contact[$field];
|
$updated[$field] = ($data[$field] ?? '') ?: $contact[$field];
|
||||||
|
|
|
@ -436,9 +436,7 @@ class Probe
|
||||||
$data['url'] = $uri;
|
$data['url'] = $uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data['photo']) && !empty($data['baseurl'])) {
|
if (empty($data['photo'])) {
|
||||||
$data['baseurl'] = Network::getUrlMatch(Strings::normaliseLink($data['baseurl']), Strings::normaliseLink($data['photo']));
|
|
||||||
} elseif (empty($data['photo'])) {
|
|
||||||
$data['photo'] = DI::baseUrl() . '/images/person-300.jpg';
|
$data['photo'] = DI::baseUrl() . '/images/person-300.jpg';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user