* @param string $uri Address that should be probed
* @param string $network Test for this specific network
* @param integer $uid User ID for the probe (only used for mails)
- * @param boolean $cache Use cached values?
*
* @return array uri data
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
- * @todo Choice: implement $cache parameter or remove documentation
*/
public static function uri(string $uri, string $network = '', int $uid = -1): array
{
}
}
- if (!empty($data['baseurl']) && empty($data['gsid'])) {
- $data['gsid'] = GServer::getID($data['baseurl']);
- }
-
if (empty($data['network'])) {
$data['network'] = Protocol::PHANTOM;
}
+ $baseurl = parse_url($data['url'], PHP_URL_SCHEME) . '://' . parse_url($data['url'], PHP_URL_HOST);
+ if (empty($data['baseurl']) && ($data['network'] == Protocol::ACTIVITYPUB) && (rtrim($data['url'], '/') == $baseurl)) {
+ $data['baseurl'] = $baseurl;
+ }
+
+ if (!empty($data['baseurl']) && empty($data['gsid'])) {
+ $data['gsid'] = GServer::getID($data['baseurl']);
+ }
+
// Ensure that local connections always are DFRN
if (($network == '') && ($data['network'] != Protocol::PHANTOM) && (self::ownHost($data['baseurl'] ?? '') || self::ownHost($data['url']))) {
$data['network'] = Protocol::DFRN;