]> git.mxchange.org Git - friendica.git/commitdiff
Some outside code relies on returned "false"
authorRoland Häder <roland@mxchange.org>
Sat, 18 Jun 2022 03:06:00 +0000 (05:06 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Jun 2022 03:06:18 +0000 (05:06 +0200)
src/Protocol/Diaspora.php

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