Continued:

- changed back to 'return false;' as other methods heavily rely on false instead
  of an empty array as pointed out by @heluecht@pirati.ca
- $fetched_contact should be initialized as an empty array, let's not make this
  code more crazier than it already is (see APContact::getByURL())
This commit is contained in:
Roland Häder 2022-06-17 11:48:52 +02:00
parent c467bff79f
commit 36d56a4041
3 changed files with 17 additions and 16 deletions

View file

@ -59,12 +59,13 @@ class Notify extends BaseModule
}
}
private static function dispatchPublic($postdata)
private static function dispatchPublic(array $postdata)
{
$msg = Diaspora::decodeRaw($postdata, '', true);
if (!$msg) {
if (!is_array($msg)) {
// We have to fail silently to be able to hand it over to the salmon parser
return false;
Logger::warning('Diaspora::decodeRaw() has failed for some reason.');
return;
}
// Fetch the corresponding public contact
@ -88,10 +89,10 @@ class Notify extends BaseModule
System::xmlExit($ret, 'Done');
}
private static function dispatchPrivate($user, $postdata)
private static function dispatchPrivate(array $user, array $postdata)
{
$msg = Diaspora::decodeRaw($postdata, $user['prvkey'] ?? '');
if (!$msg) {
if (!is_array($msg)) {
System::xmlExit(4, 'Unable to parse message');
}