Fix warning "Trying to access array offset on value of type bool"

This commit is contained in:
Michael 2024-12-29 15:51:42 +00:00
parent 4917380716
commit b915252e7e
4 changed files with 18 additions and 3 deletions

View file

@ -1866,6 +1866,11 @@ class GServer
return $serverdata;
}
if (!is_countable($data)) {
DI::logger()->notice('Unexpected return type', ['url' => $url, 'data' => $data, 'serverdata' => $serverdata]);
return $serverdata;
}
if (count($data) == 1) {
$serverdata['directory-type'] = self::DT_MASTODON;
}