]> git.mxchange.org Git - friendica.git/commitdiff
Implement functions
authorAdam Magness <adam.magness@gmail.com>
Sat, 3 Nov 2018 17:08:30 +0000 (13:08 -0400)
committerAdam Magness <adam.magness@gmail.com>
Mon, 5 Nov 2018 12:24:14 +0000 (07:24 -0500)
implement functions relocated to xml class

14 files changed:
include/conversation.php
mod/dfrn_confirm.php
mod/filer.php
mod/filerm.php
mod/photos.php
mod/poco.php
mod/poke.php
mod/profile.php
mod/subthread.php
mod/tagger.php
src/Content/Widget.php
src/Model/Event.php
src/Protocol/DFRN.php
src/Protocol/Diaspora.php

index c1d428f24486fa3857d626fb35dde7a7bfc9d1d7..7a0bf6c4003841c3744199e26e9e29077d83e8da 100644 (file)
@@ -195,7 +195,7 @@ function localize_item(&$item)
                $xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
 
                $obj = XML::parseString($xmlhead.$item['object']);
-               $links = XML::parseString($xmlhead."<links>".unxmlify($obj->link)."</links>");
+               $links = XML::parseString($xmlhead."<links>".XML::unxmlify($obj->link)."</links>");
 
                $Bname = $obj->title;
                $Blink = "";
index 0403085f85cc7485ea7ed3ad22ae867ef84b396c..6771a21575e8b9f29c679bab79058f54e3939ed9 100644 (file)
@@ -256,7 +256,7 @@ function dfrn_confirm_post(App $a, $handsfree = null)
 
                        $xml = XML::parseString($res);
                        $status = (int) $xml->status;
-                       $message = unxmlify($xml->message);   // human readable text of what may have gone wrong.
+                       $message = XML::unxmlify($xml->message);   // human readable text of what may have gone wrong.
                        switch ($status) {
                                case 0:
                                        info(L10n::t("Confirmation completed successfully.") . EOL);
index 11a5dd0576b6a8ee3513c795076cdce892130a75..d61f67e1ef46d0afb76f0bcc0274718c69dbf183 100644 (file)
@@ -8,6 +8,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Renderer;
 use Friendica\Model\FileTag;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -17,7 +18,7 @@ function filer_content(App $a)
                killme();
        }
 
-       $term = unxmlify(trim(defaults($_GET, 'term', '')));
+       $term = XML::unxmlify(trim(defaults($_GET, 'term', '')));
        $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
 
        Logger::log('filer: tag ' . $term . ' item ' . $item_id);
index d899d8f3f25a34155be3cb274b399e7ccc591e7b..60ac439bf895f8602fd78df282bbd622e3aaecd1 100644 (file)
@@ -4,6 +4,7 @@ use Friendica\App;
 use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Model\FileTag;
+use Friendica\Util\XML;
 
 function filerm_content(App $a)
 {
@@ -12,8 +13,8 @@ function filerm_content(App $a)
                killme();
        }
 
-       $term = unxmlify(trim($_GET['term']));
-       $cat = unxmlify(trim($_GET['cat']));
+       $term = XML::unxmlify(trim($_GET['term']));
+       $cat = XML::unxmlify(trim($_GET['cat']));
 
        $category = (($cat) ? true : false);
 
index 82a6ccca2962e9292e6bec004354a224301c8273..0deb164b3941c0ec388a74f36089e9e1ad7e31c7 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Map;
 use Friendica\Util\Security;
 use Friendica\Util\Temporal;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -682,15 +683,15 @@ function photos_post(App $a)
                                        $arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ;
 
                                        $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $tagged[0] . '</title><id>' . $tagged[1] . '/' . $tagged[0] . '</id>';
-                                       $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
+                                       $arr['object'] .= '<link>' . XML::xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
                                        if ($tagged[3]) {
-                                               $arr['object'] .= xmlify('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
+                                               $arr['object'] .= XML::xmlify('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
                                        }
                                        $arr['object'] .= '</link></object>' . "\n";
 
                                        $arr['target'] = '<target><type>' . ACTIVITY_OBJ_IMAGE . '</type><title>' . $p[0]['desc'] . '</title><id>'
                                                . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '</id>';
-                                       $arr['target'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
+                                       $arr['target'] .= '<link>' . XML::xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . '" />' . "\n" . '<link rel="preview" type="'.$p[0]['type'].'" href="' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '" />') . '</link></target>';
 
                                        $item_id = Item::insert($arr);
                                }
index 41fabff4ea66c98bfcab7552e55c4ff6a98dc278..119250f2fde9c749fc59d7aadd9e1bef2209b742 100644 (file)
@@ -15,6 +15,7 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\DateTimeFormat;
+use Friendica\Util\XML;
 
 function poco_init(App $a) {
        $system_mode = false;
@@ -375,7 +376,7 @@ function poco_init(App $a) {
 
        if ($format === 'xml') {
                header('Content-type: text/xml');
-               echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), array_xmlify(['$response' => $ret]));
+               echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayXmlify(['$response' => $ret]));
                killme();
        }
        if ($format === 'json') {
index be26254384d485aa5df31aa34fd5a303fb19a38b..e459be345f30885540b3d94a886de77ae9fe9927 100644 (file)
@@ -22,6 +22,7 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -124,9 +125,9 @@ function poke_init(App $a)
        $arr['body']          = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . L10n::t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]';
 
        $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $target['name'] . '</title><id>' . $target['url'] . '</id>';
-       $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
+       $arr['object'] .= '<link>' . XML::xmlify('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
 
-       $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
+       $arr['object'] .= XML::xmlify('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
        $arr['object'] .= '</link></object>' . "\n";
 
        $item_id = Item::insert($arr);
index f2df82849edf650fcc6ab608743e65021a879fd9..b92b8453e6872cf3f1f29903a4892c978b016133 100644 (file)
@@ -24,6 +24,7 @@ use Friendica\Protocol\ActivityPub;
 use Friendica\Protocol\DFRN;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Security;
+use Friendica\Util\XML;
 
 function profile_init(App $a)
 {
@@ -209,7 +210,7 @@ function profile_content(App $a, $update = 0)
                $commvisitor = $commpage && $remote_contact;
 
                $a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'], true);
-               $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? xmlify($category) : ''));
+               $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? XML::xmlify($category) : ''));
                $a->page['aside'] .= Widget::tagCloud();
 
                if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
index 36cf835c281cb9ceecbac3a9a308edeeee583776..7a8ada08b56037abc475e4a938732a45d277be99 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
 use Friendica\Util\Security;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -87,7 +88,7 @@ function subthread_content(App $a) {
 
        $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
        $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
-       $link = xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+       $link = XML::xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
        $body = $item['body'];
 
        $obj = <<< EOT
index edfcd7bd13e45a910ef13c51aa3a8a07adad6df8..8b7e7d00402fb8e5910372fd21faa65fe4c51508 100644 (file)
@@ -10,6 +10,7 @@ use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
+use Friendica\Util\XML;
 
 require_once 'include/items.php';
 
@@ -66,7 +67,7 @@ function tagger_content(App $a) {
        }
 
        $uri = Item::newURI($owner_uid);
-       $xterm = xmlify($term);
+       $xterm = XML::xmlify($term);
        $post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
        $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
 
@@ -76,9 +77,9 @@ function tagger_content(App $a) {
                $href = System::baseUrl() . '/display/' . $item['guid'];
        }
 
-       $link = xmlify('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
+       $link = XML::xmlify('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
 
-       $body = xmlify($item['body']);
+       $body = XML::xmlify($item['body']);
 
        $target = <<< EOT
        <target>
index 2f78d0fd3d387dd52f6e4830f2ed2f41c9c8b240..3e076729e1b660ab7e7af5c0efb4e9984ca04370 100644 (file)
@@ -18,6 +18,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\FileTag;
 use Friendica\Model\GContact;
 use Friendica\Model\Profile;
+use Friendica\Util\XML;
 
 require_once 'boot.php';
 require_once 'include/dba.php';
@@ -189,7 +190,7 @@ class Widget
                if ($cnt) {
                        foreach ($matches as $mtch)
                        {
-                               $unescaped = xmlify(FileTag::decode($mtch[1]));
+                               $unescaped = XML::xmlify(FileTag::decode($mtch[1]));
                                $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
                        }
                }
@@ -229,7 +230,7 @@ class Widget
 
                if ($cnt) {
                        foreach ($matches as $mtch) {
-                               $unescaped = xmlify(FileTag::decode($mtch[1]));
+                               $unescaped = XML::xmlify(FileTag::decode($mtch[1]));
                                $terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
                        }
                }
index ee61149de5b300d6b365b164d91764406ad76ef3..1f0b44693faca304ddbd27af4725acc950332052 100644 (file)
@@ -17,6 +17,7 @@ use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Map;
+use Friendica\Util\XML;
 
 require_once 'boot.php';
 require_once 'include/dba.php';
@@ -302,8 +303,8 @@ class Event extends BaseObject
 
                        $item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
                        if (DBA::isResult($item)) {
-                               $object = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($event['uri']) . '</id>';
-                               $object .= '<content>' . xmlify(self::getBBCode($event)) . '</content>';
+                               $object = '<object><type>' . XML::xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . XML::xmlify($event['uri']) . '</id>';
+                               $object .= '<content>' . XML::xmlify(self::getBBCode($event)) . '</content>';
                                $object .= '</object>' . "\n";
 
                                $fields = ['body' => self::getBBCode($event), 'object' => $object, 'edited' => $event['edited']];
@@ -353,8 +354,8 @@ class Event extends BaseObject
                        $item_arr['body']          = self::getBBCode($event);
                        $item_arr['event-id']      = $event['id'];
 
-                       $item_arr['object']  = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($event['uri']) . '</id>';
-                       $item_arr['object'] .= '<content>' . xmlify(self::getBBCode($event)) . '</content>';
+                       $item_arr['object']  = '<object><type>' . XML::xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . XML::xmlify($event['uri']) . '</id>';
+                       $item_arr['object'] .= '<content>' . XML::xmlify(self::getBBCode($event)) . '</content>';
                        $item_arr['object'] .= '</object>' . "\n";
 
                        $item_id = Item::insert($item_arr);
index 07a56cf24013ca11e99176db15a01fb801dde88d..1b83beb0ed54f83f5544af53d40b791ce8e28b02 100644 (file)
@@ -2547,7 +2547,7 @@ class DFRN
                $item["guid"] = XML::getFirstNodeValue($xpath, "dfrn:diaspora_guid/text()", $entry);
 
                // We store the data from "dfrn:diaspora_signature" in a different table, this is done in "Item::insert"
-               $dsprsig = unxmlify(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
+               $dsprsig = XML::unxmlify(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
                if ($dsprsig != "") {
                        $item["dsprsig"] = $dsprsig;
                }
index 66a19d839ca7f7572d3ebea76d8d328eacb07e9a..dccc3358bd3974b679ca8573375cd4b6cbbed438 100644 (file)
@@ -463,7 +463,7 @@ class Diaspora
                }
 
                return ['message' => (string)base64url_decode($base->data),
-                               'author' => unxmlify($author_addr),
+                               'author' => XML::unxmlify($author_addr),
                                'key' => (string)$key];
        }
 
@@ -603,7 +603,7 @@ class Diaspora
                Logger::log('Message verified.');
 
                return ['message' => (string)$inner_decrypted,
-                               'author' => unxmlify($author_link),
+                               'author' => XML::unxmlify($author_link),
                                'key' => (string)$key];
        }
 
@@ -1505,9 +1505,9 @@ class Diaspora
         */
        private static function receiveAccountMigration(array $importer, $data)
        {
-               $old_handle = notags(unxmlify($data->author));
-               $new_handle = notags(unxmlify($data->profile->author));
-               $signature = notags(unxmlify($data->signature));
+               $old_handle = notags(XML::unxmlify($data->author));
+               $new_handle = notags(XML::unxmlify($data->profile->author));
+               $signature = notags(XML::unxmlify($data->signature));
 
                $contact = self::contactByHandle($importer["uid"], $old_handle);
                if (!$contact) {
@@ -1565,7 +1565,7 @@ class Diaspora
         */
        private static function receiveAccountDeletion($data)
        {
-               $author = notags(unxmlify($data->author));
+               $author = notags(XML::unxmlify($data->author));
 
                $contacts = DBA::select('contact', ['id'], ['addr' => $author]);
                while ($contact = DBA::fetch($contacts)) {
@@ -1656,19 +1656,19 @@ class Diaspora
         */
        private static function receiveComment(array $importer, $sender, $data, $xml)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $parent_guid = notags(unxmlify($data->parent_guid));
-               $text = unxmlify($data->text);
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $parent_guid = notags(XML::unxmlify($data->parent_guid));
+               $text = XML::unxmlify($data->text);
 
                if (isset($data->created_at)) {
-                       $created_at = DateTimeFormat::utc(notags(unxmlify($data->created_at)));
+                       $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
                } else {
                        $created_at = DateTimeFormat::utcNow();
                }
 
                if (isset($data->thread_parent_guid)) {
-                       $thread_parent_guid = notags(unxmlify($data->thread_parent_guid));
+                       $thread_parent_guid = notags(XML::unxmlify($data->thread_parent_guid));
                        $thr_uri = self::getUriFromGuid("", $thread_parent_guid, true);
                } else {
                        $thr_uri = "";
@@ -1773,24 +1773,24 @@ class Diaspora
         */
        private static function receiveConversationMessage(array $importer, array $contact, $data, $msg, $mesg, $conversation)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $subject = notags(unxmlify($data->subject));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $subject = notags(XML::unxmlify($data->subject));
 
                // "diaspora_handle" is the element name from the old version
                // "author" is the element name from the new version
                if ($mesg->author) {
-                       $msg_author = notags(unxmlify($mesg->author));
+                       $msg_author = notags(XML::unxmlify($mesg->author));
                } elseif ($mesg->diaspora_handle) {
-                       $msg_author = notags(unxmlify($mesg->diaspora_handle));
+                       $msg_author = notags(XML::unxmlify($mesg->diaspora_handle));
                } else {
                        return false;
                }
 
-               $msg_guid = notags(unxmlify($mesg->guid));
-               $msg_conversation_guid = notags(unxmlify($mesg->conversation_guid));
-               $msg_text = unxmlify($mesg->text);
-               $msg_created_at = DateTimeFormat::utc(notags(unxmlify($mesg->created_at)));
+               $msg_guid = notags(XML::unxmlify($mesg->guid));
+               $msg_conversation_guid = notags(XML::unxmlify($mesg->conversation_guid));
+               $msg_text = XML::unxmlify($mesg->text);
+               $msg_created_at = DateTimeFormat::utc(notags(XML::unxmlify($mesg->created_at)));
 
                if ($msg_conversation_guid != $guid) {
                        Logger::log("message conversation guid does not belong to the current conversation.");
@@ -1861,11 +1861,11 @@ class Diaspora
         */
        private static function receiveConversation(array $importer, $msg, $data)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $subject = notags(unxmlify($data->subject));
-               $created_at = DateTimeFormat::utc(notags(unxmlify($data->created_at)));
-               $participants = notags(unxmlify($data->participants));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $subject = notags(XML::unxmlify($data->subject));
+               $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
+               $participants = notags(XML::unxmlify($data->participants));
 
                $messages = $data->message;
 
@@ -1919,11 +1919,11 @@ class Diaspora
         */
        private static function receiveLike(array $importer, $sender, $data)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $parent_guid = notags(unxmlify($data->parent_guid));
-               $parent_type = notags(unxmlify($data->parent_type));
-               $positive = notags(unxmlify($data->positive));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $parent_guid = notags(XML::unxmlify($data->parent_guid));
+               $parent_type = notags(XML::unxmlify($data->parent_type));
+               $positive = notags(XML::unxmlify($data->positive));
 
                // likes on comments aren't supported by Diaspora - only on posts
                // But maybe this will be supported in the future, so we will accept it.
@@ -2028,11 +2028,11 @@ class Diaspora
         */
        private static function receiveMessage(array $importer, $data)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $conversation_guid = notags(unxmlify($data->conversation_guid));
-               $text = unxmlify($data->text);
-               $created_at = DateTimeFormat::utc(notags(unxmlify($data->created_at)));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $conversation_guid = notags(XML::unxmlify($data->conversation_guid));
+               $text = XML::unxmlify($data->text);
+               $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
 
                $contact = self::allowedContactByHandle($importer, $author, true);
                if (!$contact) {
@@ -2103,8 +2103,8 @@ class Diaspora
         */
        private static function receiveParticipation(array $importer, $data)
        {
-               $author = strtolower(notags(unxmlify($data->author)));
-               $parent_guid = notags(unxmlify($data->parent_guid));
+               $author = strtolower(notags(XML::unxmlify($data->author)));
+               $parent_guid = notags(XML::unxmlify($data->parent_guid));
 
                $contact_id = Contact::getIdForURL($author);
                if (!$contact_id) {
@@ -2196,22 +2196,22 @@ class Diaspora
         */
        private static function receiveProfile(array $importer, $data)
        {
-               $author = strtolower(notags(unxmlify($data->author)));
+               $author = strtolower(notags(XML::unxmlify($data->author)));
 
                $contact = self::contactByHandle($importer["uid"], $author);
                if (!$contact) {
                        return false;
                }
 
-               $name = unxmlify($data->first_name).((strlen($data->last_name)) ? " ".unxmlify($data->last_name) : "");
-               $image_url = unxmlify($data->image_url);
-               $birthday = unxmlify($data->birthday);
-               $gender = unxmlify($data->gender);
-               $about = Markdown::toBBCode(unxmlify($data->bio));
-               $location = Markdown::toBBCode(unxmlify($data->location));
-               $searchable = (unxmlify($data->searchable) == "true");
-               $nsfw = (unxmlify($data->nsfw) == "true");
-               $tags = unxmlify($data->tag_string);
+               $name = XML::unxmlify($data->first_name).((strlen($data->last_name)) ? " ".XML::unxmlify($data->last_name) : "");
+               $image_url = XML::unxmlify($data->image_url);
+               $birthday = XML::unxmlify($data->birthday);
+               $gender = XML::unxmlify($data->gender);
+               $about = Markdown::toBBCode(XML::unxmlify($data->bio));
+               $location = Markdown::toBBCode(XML::unxmlify($data->location));
+               $searchable = (XML::unxmlify($data->searchable) == "true");
+               $nsfw = (XML::unxmlify($data->nsfw) == "true");
+               $tags = XML::unxmlify($data->tag_string);
 
                $tags = explode("#", $tags);
 
@@ -2310,8 +2310,8 @@ class Diaspora
         */
        private static function receiveContactRequest(array $importer, $data)
        {
-               $author = unxmlify($data->author);
-               $recipient = unxmlify($data->recipient);
+               $author = XML::unxmlify($data->author);
+               $recipient = XML::unxmlify($data->recipient);
 
                if (!$author || !$recipient) {
                        return false;
@@ -2320,13 +2320,13 @@ class Diaspora
                // the current protocol version doesn't know these fields
                // That means that we will assume their existance
                if (isset($data->following)) {
-                       $following = (unxmlify($data->following) == "true");
+                       $following = (XML::unxmlify($data->following) == "true");
                } else {
                        $following = true;
                }
 
                if (isset($data->sharing)) {
-                       $sharing = (unxmlify($data->sharing) == "true");
+                       $sharing = (XML::unxmlify($data->sharing) == "true");
                } else {
                        $sharing = true;
                }
@@ -2573,13 +2573,13 @@ class Diaspora
         */
        private static function receiveReshare(array $importer, $data, $xml)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $created_at = DateTimeFormat::utc(notags(unxmlify($data->created_at)));
-               $root_author = notags(unxmlify($data->root_author));
-               $root_guid = notags(unxmlify($data->root_guid));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
+               $root_author = notags(XML::unxmlify($data->root_author));
+               $root_guid = notags(XML::unxmlify($data->root_guid));
                /// @todo handle unprocessed property "provider_display_name"
-               $public = notags(unxmlify($data->public));
+               $public = notags(XML::unxmlify($data->public));
 
                $contact = self::allowedContactByHandle($importer, $author, false);
                if (!$contact) {
@@ -2665,9 +2665,9 @@ class Diaspora
         */
        private static function itemRetraction(array $importer, array $contact, $data)
        {
-               $author = notags(unxmlify($data->author));
-               $target_guid = notags(unxmlify($data->target_guid));
-               $target_type = notags(unxmlify($data->target_type));
+               $author = notags(XML::unxmlify($data->author));
+               $target_guid = notags(XML::unxmlify($data->target_guid));
+               $target_type = notags(XML::unxmlify($data->target_type));
 
                $person = self::personByHandle($author);
                if (!is_array($person)) {
@@ -2729,7 +2729,7 @@ class Diaspora
         */
        private static function receiveRetraction(array $importer, $sender, $data)
        {
-               $target_type = notags(unxmlify($data->target_type));
+               $target_type = notags(XML::unxmlify($data->target_type));
 
                $contact = self::contactByHandle($importer["uid"], $sender);
                if (!$contact && (in_array($target_type, ["Contact", "Person"]))) {
@@ -2774,12 +2774,12 @@ class Diaspora
         */
        private static function receiveStatusMessage(array $importer, SimpleXMLElement $data, $xml)
        {
-               $author = notags(unxmlify($data->author));
-               $guid = notags(unxmlify($data->guid));
-               $created_at = DateTimeFormat::utc(notags(unxmlify($data->created_at)));
-               $public = notags(unxmlify($data->public));
-               $text = unxmlify($data->text);
-               $provider_display_name = notags(unxmlify($data->provider_display_name));
+               $author = notags(XML::unxmlify($data->author));
+               $guid = notags(XML::unxmlify($data->guid));
+               $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
+               $public = notags(XML::unxmlify($data->public));
+               $text = XML::unxmlify($data->text);
+               $provider_display_name = notags(XML::unxmlify($data->provider_display_name));
 
                $contact = self::allowedContactByHandle($importer, $author, false);
                if (!$contact) {
@@ -2794,7 +2794,7 @@ class Diaspora
                $address = [];
                if ($data->location) {
                        foreach ($data->location->children() as $fieldname => $data) {
-                               $address[$fieldname] = notags(unxmlify($data));
+                               $address[$fieldname] = notags(XML::unxmlify($data));
                        }
                }
 
@@ -2805,8 +2805,8 @@ class Diaspora
                // Attach embedded pictures to the body
                if ($data->photo) {
                        foreach ($data->photo as $photo) {
-                               $body = "[img]".unxmlify($photo->remote_photo_path).
-                                       unxmlify($photo->remote_photo_name)."[/img]\n".$body;
+                               $body = "[img]".XML::unxmlify($photo->remote_photo_path).
+                                       XML::unxmlify($photo->remote_photo_name)."[/img]\n".$body;
                        }
 
                        $datarray["object-type"] = ACTIVITY_OBJ_IMAGE;