Fix some warnings

This commit is contained in:
Michael 2025-05-24 19:09:49 +00:00
parent 8e0a3d00bb
commit 2335af9bf2
3 changed files with 12 additions and 6 deletions

View file

@ -145,9 +145,11 @@ class Actor
$fields['gsid'] = GServer::getRealID($fields['baseurl'], true); $fields['gsid'] = GServer::getRealID($fields['baseurl'], true);
} }
foreach ($directory->verificationMethod as $method) { if (!empty($directory->verificationMethod)) {
if (!empty($method->publicKeyMultibase)) { foreach ($directory->verificationMethod as $method) {
$fields['pubkey'] = $method->publicKeyMultibase; if (!empty($method->publicKeyMultibase)) {
$fields['pubkey'] = $method->publicKeyMultibase;
}
} }
} }
} }

View file

@ -105,8 +105,12 @@ class Jetstream
$last_timeout = time(); $last_timeout = time();
while (true) { while (true) {
try { try {
$message = $this->client->receive(); $message = @$this->client->receive();
$data = json_decode($message); if (empty($message)) {
$this->logger->notice('Empty message received');
break;
}
$data = json_decode($message);
if (is_object($data)) { if (is_object($data)) {
$timestamp = $data->time_us; $timestamp = $data->time_us;
$this->route($data); $this->route($data);

View file

@ -2065,7 +2065,7 @@ class Receiver
} }
foreach ($object_data['tags'] as $tag) { foreach ($object_data['tags'] as $tag) {
if (HTTPSignature::isValidContentType($tag['mediaType'] ?? '', $tag['href'])) { if (HTTPSignature::isValidContentType($tag['mediaType'] ?? '', $tag['href'] ?? '')) {
$object_data['quote-url'] = $tag['href']; $object_data['quote-url'] = $tag['href'];
} }
} }