From 138a15404f6e30fb80450473364362900ee31a96 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 20 Jul 2022 05:38:53 +0000 Subject: [PATCH 1/2] Fix processing of incoming Diaspora messages --- src/Protocol/Diaspora.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 6d3c23dad6..1f21ea4981 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -705,7 +705,7 @@ class Diaspora // This is something that shouldn't happen at all. if (in_array($type, ['status_message', 'reshare', 'profile'])) { if ($msg['author'] != $fields->author) { - Logger::notice("Message handle is not the same as envelope sender. Quitting this message."); + Logger::notice('Message handle is not the same as envelope sender. Quitting this message.', ['author1' => $msg['author'], 'author2' => $fields->author]); return false; } } @@ -760,7 +760,7 @@ class Diaspora { $handle = strval($handle); - Logger::notice("Fetching diaspora key for: " . $handle); + Logger::notice('Fetching diaspora key', ['handle' => $handle, 'callstack' => System::callstack(20)]); $fcontact = FContact::getByURL($handle); if (!empty($fcontact['pubkey'])) { From c20c0a1812560d81ab5c0408d952eb4ae68ebc8b Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 20 Jul 2022 05:47:30 +0000 Subject: [PATCH 2/2] Restore the original functionality --- src/Util/XML.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Util/XML.php b/src/Util/XML.php index e371ea3cd6..a6e6cd5bab 100644 --- a/src/Util/XML.php +++ b/src/Util/XML.php @@ -141,9 +141,9 @@ class XML * @param string $elementname Name of the XML element of the target * @return void */ - public static function copy(&$source, &$target, string $elementname) + public static function copy(&$source, &$target, $elementname) { - if (is_string($source)) { + if (count($source->children()) == 0) { $target->addChild($elementname, self::escape($source)); } else { $child = $target->addChild($elementname);