]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: XML copy had problems with "&"
authorMichael Vogel <icarus@dabo.de>
Mon, 14 Mar 2016 22:54:01 +0000 (23:54 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 14 Mar 2016 22:54:01 +0000 (23:54 +0100)
include/diaspora.php
include/xml.php

index 75cedeccd1b3254a91b4221702539c755a745050..4c3cb41726789cc8cc061e4ca94ddc4038ba75fb 100644 (file)
@@ -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;
 
index c2313648cece89af0f171529a53286515d893009..c74c23c473ce3254a717e155e8c6a707958dd58e 100644 (file)
@@ -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)