Commit c6d9c079 authored by dmorley's avatar dmorley

fix for bad nodeinfo

parent 14d342cc
Pipeline #4119 failed with stage
in 4 seconds
......@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
### Deprecated
### Removed
### Fixed
- nodeinfo that does not follow the spec will lower score
### Security
## [2.6.3]
......
......@@ -146,11 +146,15 @@ foreach ($pods as $pod) {
$jsonssl = json_decode($outputssl ?: '');
if ($jsonssl !== null) {
$version = $jsonssl->software->version ?? 0;
$version = $jsonssl->software->version ?? '999.999.999';
if ($version == '999.999.999') {
//if nodeinfo has no version info then mark invalid
$score -= 2;
}
preg_match_all('((?:\d(.|-)?)+(\.)\d+\.*)', $version, $sversion);
$shortversion = $sversion[0][0] ?? '0.0.0.0';
$signup = ($jsonssl->openRegistrations ?? false) === true;
$softwarename = strtolower($jsonssl->software->name) ?? 'unknown';
$softwarename = $jsonssl->software->name ? strtolower($jsonssl->software->name) : 'unknown';
$name = $jsonssl->metadata->nodeName ?? $softwarename;
//dirty hack for badnodeinfo, this complains a lot, not a good fix.
$total_users = isset($jsonssl->usage->users->total) ? $jsonssl->usage->users->total : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment