* @return array profile array
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
+ * @todo Rewrite parameter $update to avoid true|false|null (boolean is binary, null adds a third case)
*/
public static function getByURL(string $url, $update = null): array
{
return [];
}
- $fetched_contact = false;
+ $fetched_contact = [];
if (empty($update)) {
if (is_null($update)) {
return $fetched_contact;
}
$url = $apcontact['url'];
+ } elseif (empty(parse_url($url, PHP_URL_PATH))) {
+ $apcontact['baseurl'] = $url;
}
// Detect multiple fast repeating request to the same address
if ($failed) {
self::markForArchival($fetched_contact ?: []);
- return $fetched_contact ?? [];
+ return $fetched_contact;
}
}
}
// Limit the length on incoming fields
- $apcontact = DBStructure::getFieldsForTable('apcontact', $apcontact);
+ $apcontact = DI::dbaDefinition()->truncateFieldsForTable('apcontact', $apcontact);
if (DBA::exists('apcontact', ['url' => $apcontact['url']])) {
DBA::update('apcontact', $apcontact, ['url' => $apcontact['url']]);
*
* @param string $url inbox url
* @param boolean $shared Shared Inbox
+ * @return void
*/
private static function unarchiveInbox(string $url, bool $shared)
{