Merge pull request #11769 from MrPetovan/bug/fatal-errors

Fix wrong type-hint in Module/DFRN/Notify
This commit is contained in:
Michael Vogel 2022-07-25 15:24:49 +02:00 committed by GitHub
commit 389e59b857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -59,13 +59,13 @@ class Notify extends BaseModule
}
}
private static function dispatchPublic(array $postdata)
private static function dispatchPublic(string $postdata): bool
{
$msg = Diaspora::decodeRaw($postdata, '', true);
if (!is_array($msg)) {
// We have to fail silently to be able to hand it over to the salmon parser
Logger::warning('Diaspora::decodeRaw() has failed for some reason.');
return;
return false;
}
// Fetch the corresponding public contact
@ -87,6 +87,8 @@ class Notify extends BaseModule
// Now we should be able to import it
$ret = DFRN::import($msg['message'], $importer, Conversation::PARCEL_DIASPORA_DFRN, Conversation::RELAY);
System::xmlExit($ret, 'Done');
return true;
}
private static function dispatchPrivate(array $user, string $postdata)