- added more missing type-hints (checked them in body of the method)
- reformatted code a little (code-style)
- moved '/.well-known/host-meta' to constant Probe::HOST_META
This commit is contained in:
Roland Häder 2022-10-25 20:22:19 +02:00
parent a7e9457ef2
commit 5306bb3e31
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
4 changed files with 101 additions and 64 deletions

View file

@ -1359,9 +1359,10 @@ class Contact
'writable' => 1,
'blocked' => 0,
'readonly' => 0,
'pending' => 0];
'pending' => 0,
];
$condition = ['nurl' => Strings::normaliseLink($data["url"]), 'uid' => $uid, 'deleted' => false];
$condition = ['nurl' => Strings::normaliseLink($data['url']), 'uid' => $uid, 'deleted' => false];
// Before inserting we do check if the entry does exist now.
$contact = DBA::selectFirst('contact', ['id'], $condition, ['order' => ['id']]);

View file

@ -1325,7 +1325,7 @@ class GServer
private static function validHostMeta(string $url): bool
{
$xrd_timeout = DI::config()->get('system', 'xrd_timeout');
$curlResult = DI::httpClient()->get($url . '/.well-known/host-meta', HttpClientAccept::XRD_XML, [HttpClientOptions::TIMEOUT => $xrd_timeout]);
$curlResult = DI::httpClient()->get($url . Probe::HOST_META, HttpClientAccept::XRD_XML, [HttpClientOptions::TIMEOUT => $xrd_timeout]);
if (!$curlResult->isSuccess()) {
return false;
}