From: Michael Vogel Date: Mon, 14 Mar 2016 22:54:01 +0000 (+0100) Subject: Bugfix: XML copy had problems with "&" X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b5e7007a7148d85858f6851bdb8900dfb05e7cd;p=friendica.git Bugfix: XML copy had problems with "&" --- diff --git a/include/diaspora.php b/include/diaspora.php index 75cedeccd1..4c3cb41726 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -291,7 +291,7 @@ class diaspora { return self::receive_account_deletion($importer, $fields); case "comment": - return self::receive_comment($importer, $sender, $fields); + return self::receive_comment($importer, $sender, $fields, $msg["message"]); case "conversation": return self::receive_conversation($importer, $msg, $fields); @@ -324,7 +324,7 @@ class diaspora { return self::receive_retraction($importer, $sender, $fields); case "status_message": - return self::receive_status_message($importer, $fields); + return self::receive_status_message($importer, $fields, $msg["message"]); default: logger("Unknown message type ".$type); @@ -841,7 +841,7 @@ class diaspora { return true; } - private function receive_comment($importer, $sender, $data) { + private function receive_comment($importer, $sender, $data, $xml) { $guid = notags(unxmlify($data->guid)); $parent_guid = notags(unxmlify($data->parent_guid)); $text = unxmlify($data->text); @@ -890,7 +890,7 @@ class diaspora { $datarray["parent-uri"] = $parent_item["uri"]; $datarray["object-type"] = ACTIVITY_OBJ_COMMENT; - $datarray["object"] = json_encode($data); + $datarray["object"] = $xml; $datarray["body"] = diaspora2bb($text); @@ -1769,7 +1769,7 @@ class diaspora { return true; } - private function receive_status_message($importer, $data) { + private function receive_status_message($importer, $data, $xml) { $raw_message = unxmlify($data->raw_message); $guid = notags(unxmlify($data->guid)); @@ -1831,7 +1831,7 @@ class diaspora { $datarray["verb"] = ACTIVITY_POST; $datarray["gravity"] = GRAVITY_PARENT; - $datarray["object"] = json_encode($data); + $datarray["object"] = $xml; $datarray["body"] = $body; diff --git a/include/xml.php b/include/xml.php index c2313648ce..c74c23c473 100644 --- a/include/xml.php +++ b/include/xml.php @@ -62,7 +62,7 @@ class xml { function copy(&$source, &$target, $elementname) { if (count($source->children()) == 0) - $target->addChild($elementname, $source); + $target->addChild($elementname, xmlify($source)); else { $child = $target->addChild($elementname); foreach ($source->children() AS $childfield => $childentry)