X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FGServer.php;h=13dd13af446efc85752ef12b0e5f28648096865d;hb=bbb5440144a6a8421350ef6c0176be9c05df5527;hp=04b07889cad31db21384d970414abc6653e66b9b;hpb=9c1516feb233a1df7e20d4c5c247af92d5d90d97;p=friendica.git diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 04b07889ca..13dd13af44 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -1503,7 +1503,7 @@ class GServer $generator = explode(' ', JsonLD::fetchElement($actor['as:generator'], 'as:name', '@value')); $serverdata['platform'] = strtolower(array_shift($generator)); $serverdata['detection-method'] = self::DETECT_SYSTEM_ACTOR; - if (self::isNomad($actor['@id'])) { + if (self::isNomad($actor)) { $serverdata['version'] = $serverdata['platform']; $serverdata['platform'] = 'nomad'; } @@ -1530,15 +1530,20 @@ class GServer } /** - * Detect if the given url belongs to a nomad account + * Detect if the given actor is a nomad account * - * @param string $url + * @param array $actor * @return boolean */ - private static function isNomad(string $url): bool + private static function isNomad(array $actor): bool { - foreach (Probe::lrdd($url) as $attribute) { - if ((($attribute['@attributes']['rel'] ?? '') == 'http://purl.org/nomad') && (($attribute['@attributes']['type'] ?? '') == 'application/x-nomad+json')) { + $tags = JsonLD::fetchElementArray($actor, 'as:tag'); + if (empty($tags)) { + return false; + } + + foreach ($tags as $tag) { + if ((($tag['as:name'] ?? '') == 'Protocol') && (($tag['sc:value'] ?? '') == 'nomad')) { return true; } }