mirror of
https://github.com/friendica/friendica
synced 2025-04-29 19:44:22 +02:00
Issue 8675: reduce requests of foreign pages
This commit is contained in:
parent
4a363b50b4
commit
e379698227
7 changed files with 51 additions and 47 deletions
|
@ -276,15 +276,17 @@ class APContact
|
|||
}
|
||||
}
|
||||
|
||||
$parts = parse_url($apcontact['url']);
|
||||
unset($parts['path']);
|
||||
$baseurl = Network::unparseURL($parts);
|
||||
if (empty($fetched_contact['baseurl']) || $update) {
|
||||
$parts = parse_url($apcontact['url']);
|
||||
unset($parts['path']);
|
||||
$baseurl = Network::unparseURL($parts);
|
||||
|
||||
// Check if the address is resolvable or the profile url is identical with the base url of the system
|
||||
if (self::addrToUrl($apcontact['addr'], $apcontact['url']) || Strings::compareLink($apcontact['url'], $baseurl)) {
|
||||
$apcontact['baseurl'] = $baseurl;
|
||||
} else {
|
||||
$apcontact['addr'] = null;
|
||||
// Check if the address is resolvable or the profile url is identical with the base url of the system
|
||||
if (self::addrToUrl($apcontact['addr'], $apcontact['url']) || Strings::compareLink($apcontact['url'], $baseurl)) {
|
||||
$apcontact['baseurl'] = $baseurl;
|
||||
} else {
|
||||
$apcontact['addr'] = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($apcontact['baseurl'])) {
|
||||
|
@ -312,7 +314,7 @@ class APContact
|
|||
DBA::delete('apcontact', ['url' => $url]);
|
||||
}
|
||||
|
||||
Logger::log('Updated profile for ' . $url, Logger::DEBUG);
|
||||
Logger::info('Updated profile', ['url' => $url]);
|
||||
|
||||
return $apcontact;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue