Some outside code relies on returned "false"

This commit is contained in:
Roland Häder 2022-06-18 05:06:00 +02:00
parent aaf5c323b6
commit 89302d0843
Signed by: roland
GPG key ID: C82EDE5DDFA0BA77

View file

@ -323,14 +323,14 @@ class Diaspora
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
*/ */
public static function decode(string $xml, string $privKey = ''): array public static function decode(string $xml, string $privKey = '')
{ {
$public = false; $public = false;
$basedom = XML::parseString($xml); $basedom = XML::parseString($xml);
if (!is_object($basedom)) { if (!is_object($basedom)) {
Logger::notice('XML is not parseable.'); Logger::notice('XML is not parseable.');
return []; return false;
} }
$children = $basedom->children('https://joindiaspora.com/protocol'); $children = $basedom->children('https://joindiaspora.com/protocol');
@ -344,7 +344,7 @@ class Diaspora
// This happens with posts from a relais // This happens with posts from a relais
if (empty($privKey)) { if (empty($privKey)) {
Logger::info('This is no private post in the old format'); Logger::info('This is no private post in the old format');
return []; return false;
} }
$encrypted_header = json_decode(base64_decode($children->encrypted_header)); $encrypted_header = json_decode(base64_decode($children->encrypted_header));