update function calls to new names
15 files changed:
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
$obj = XML::parseString($xmlhead.$item['object']);
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
$obj = XML::parseString($xmlhead.$item['object']);
- $links = XML::parseString($xmlhead."<links>".XML::unxmlify($obj->link)."</links>");
+ $links = XML::parseString($xmlhead."<links>".XML::unescape($obj->link)."</links>");
$Bname = $obj->title;
$Blink = "";
$Bname = $obj->title;
$Blink = "";
if ($cnt) {
foreach ($matches as $mtch) {
$categories[] = [
if ($cnt) {
foreach ($matches as $mtch) {
$categories[] = [
- 'name' => XML::xmlify(FileTag::decode($mtch[1])),
+ 'name' => XML::escape(FileTag::decode($mtch[1])),
- 'removeurl' => ((local_user() == $item['uid'])?'filerm/' . $item['id'] . '?f=&cat=' . XML::xmlify(FileTag::decode($mtch[1])):""),
+ 'removeurl' => ((local_user() == $item['uid'])?'filerm/' . $item['id'] . '?f=&cat=' . XML::escape(FileTag::decode($mtch[1])):""),
'first' => $first,
'last' => false
];
'first' => $first,
'last' => false
];
if ($cnt) {
foreach ($matches as $mtch) {
$folders[] = [
if ($cnt) {
foreach ($matches as $mtch) {
$folders[] = [
- 'name' => XML::xmlify(FileTag::decode($mtch[1])),
+ 'name' => XML::escape(FileTag::decode($mtch[1])),
- 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&term=' . XML::xmlify(FileTag::decode($mtch[1])) : ""),
+ 'removeurl' => ((local_user() == $item['uid']) ? 'filerm/' . $item['id'] . '?f=&term=' . XML::escape(FileTag::decode($mtch[1])) : ""),
'first' => $first,
'last' => false
];
'first' => $first,
'last' => false
];
$xml = XML::parseString($res);
$status = (int) $xml->status;
$xml = XML::parseString($res);
$status = (int) $xml->status;
- $message = XML::unxmlify($xml->message); // human readable text of what may have gone wrong.
+ $message = XML::unescape($xml->message); // human readable text of what may have gone wrong.
switch ($status) {
case 0:
info(L10n::t("Confirmation completed successfully.") . EOL);
switch ($status) {
case 0:
info(L10n::t("Confirmation completed successfully.") . EOL);
- $term = XML::unxmlify(trim(defaults($_GET, 'term', '')));
+ $term = XML::unescape(trim(defaults($_GET, 'term', '')));
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
Logger::log('filer: tag ' . $term . ' item ' . $item_id);
$item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
Logger::log('filer: tag ' . $term . ' item ' . $item_id);
- $term = XML::unxmlify(trim($_GET['term']));
- $cat = XML::unxmlify(trim($_GET['cat']));
+ $term = XML::unescape(trim($_GET['term']));
+ $cat = XML::unescape(trim($_GET['cat']));
$category = (($cat) ? true : false);
$category = (($cat) ? true : false);
$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['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>' . XML::xmlify('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
+ $arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $tagged[1] . '" />' . "\n");
- $arr['object'] .= XML::xmlify('<link rel="photo" type="'.$p[0]['type'].'" href="' . $tagged[3]['photo'] . '" />' . "\n");
+ $arr['object'] .= XML::escape('<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['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>' . 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>';
+ $arr['target'] .= '<link>' . XML::escape('<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);
}
$item_id = Item::insert($arr);
}
if ($format === 'xml') {
header('Content-type: text/xml');
if ($format === 'xml') {
header('Content-type: text/xml');
- echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayXmlify(['$response' => $ret]));
+ echo Renderer::replaceMacros(Renderer::getMarkupTemplate('poco_xml.tpl'), XML::arrayEscape(['$response' => $ret]));
killme();
}
if ($format === 'json') {
killme();
}
if ($format === 'json') {
$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['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>' . XML::xmlify('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
+ $arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $target['url'] . '" />' . "\n");
- $arr['object'] .= XML::xmlify('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
+ $arr['object'] .= XML::escape('<link rel="photo" type="image/jpeg" href="' . $target['photo'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
$item_id = Item::insert($arr);
$arr['object'] .= '</link></object>' . "\n";
$item_id = Item::insert($arr);
$commvisitor = $commpage && $remote_contact;
$a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'], true);
$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) ? XML::xmlify($category) : ''));
+ $a->page['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], (!empty($category) ? XML::escape($category) : ''));
$a->page['aside'] .= Widget::tagCloud();
if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
$a->page['aside'] .= Widget::tagCloud();
if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
- $link = XML::xmlify('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
+ $link = XML::escape('<link rel="alternate" type="text/html" href="' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ;
$body = $item['body'];
$obj = <<< EOT
$body = $item['body'];
$obj = <<< EOT
}
$uri = Item::newURI($owner_uid);
}
$uri = Item::newURI($owner_uid);
- $xterm = XML::xmlify($term);
+ $xterm = XML::escape($term);
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$post_type = (($item['resource-id']) ? L10n::t('photo') : L10n::t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE );
$href = System::baseUrl() . '/display/' . $item['guid'];
}
$href = System::baseUrl() . '/display/' . $item['guid'];
}
- $link = XML::xmlify('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
+ $link = XML::escape('<link rel="alternate" type="text/html" href="'. $href . '" />' . "\n") ;
- $body = XML::xmlify($item['body']);
+ $body = XML::escape($item['body']);
$target = <<< EOT
<target>
$target = <<< EOT
<target>
if ($cnt) {
foreach ($matches as $mtch)
{
if ($cnt) {
foreach ($matches as $mtch)
{
- $unescaped = XML::xmlify(FileTag::decode($mtch[1]));
+ $unescaped = XML::escape(FileTag::decode($mtch[1]));
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
if ($cnt) {
foreach ($matches as $mtch) {
if ($cnt) {
foreach ($matches as $mtch) {
- $unescaped = XML::xmlify(FileTag::decode($mtch[1]));
+ $unescaped = XML::escape(FileTag::decode($mtch[1]));
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
$terms[] = array('name' => $unescaped, 'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
$item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
if (DBA::isResult($item)) {
$item = Item::selectFirst(['id'], ['event-id' => $event['id'], 'uid' => $event['uid']]);
if (DBA::isResult($item)) {
- $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><type>' . XML::escape(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
+ $object .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
$object .= '</object>' . "\n";
$fields = ['body' => self::getBBCode($event), 'object' => $object, 'edited' => $event['edited']];
$object .= '</object>' . "\n";
$fields = ['body' => self::getBBCode($event), 'object' => $object, 'edited' => $event['edited']];
$item_arr['body'] = self::getBBCode($event);
$item_arr['event-id'] = $event['id'];
$item_arr['body'] = self::getBBCode($event);
$item_arr['event-id'] = $event['id'];
- $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><type>' . XML::escape(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
+ $item_arr['object'] .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
$item_arr['object'] .= '</object>' . "\n";
$item_id = Item::insert($item_arr);
$item_arr['object'] .= '</object>' . "\n";
$item_id = Item::insert($item_arr);
$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"
$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 = XML::unxmlify(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
+ $dsprsig = XML::unescape(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
if ($dsprsig != "") {
$item["dsprsig"] = $dsprsig;
}
if ($dsprsig != "") {
$item["dsprsig"] = $dsprsig;
}
}
return ['message' => (string)base64url_decode($base->data),
}
return ['message' => (string)base64url_decode($base->data),
- 'author' => XML::unxmlify($author_addr),
+ 'author' => XML::unescape($author_addr),
'key' => (string)$key];
}
'key' => (string)$key];
}
Logger::log('Message verified.');
return ['message' => (string)$inner_decrypted,
Logger::log('Message verified.');
return ['message' => (string)$inner_decrypted,
- 'author' => XML::unxmlify($author_link),
+ 'author' => XML::unescape($author_link),
'key' => (string)$key];
}
'key' => (string)$key];
}
*/
private static function receiveAccountMigration(array $importer, $data)
{
*/
private static function receiveAccountMigration(array $importer, $data)
{
- $old_handle = notags(XML::unxmlify($data->author));
- $new_handle = notags(XML::unxmlify($data->profile->author));
- $signature = notags(XML::unxmlify($data->signature));
+ $old_handle = notags(XML::unescape($data->author));
+ $new_handle = notags(XML::unescape($data->profile->author));
+ $signature = notags(XML::unescape($data->signature));
$contact = self::contactByHandle($importer["uid"], $old_handle);
if (!$contact) {
$contact = self::contactByHandle($importer["uid"], $old_handle);
if (!$contact) {
*/
private static function receiveAccountDeletion($data)
{
*/
private static function receiveAccountDeletion($data)
{
- $author = notags(XML::unxmlify($data->author));
+ $author = notags(XML::unescape($data->author));
$contacts = DBA::select('contact', ['id'], ['addr' => $author]);
while ($contact = DBA::fetch($contacts)) {
$contacts = DBA::select('contact', ['id'], ['addr' => $author]);
while ($contact = DBA::fetch($contacts)) {
*/
private static function receiveComment(array $importer, $sender, $data, $xml)
{
*/
private static function receiveComment(array $importer, $sender, $data, $xml)
{
- $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);
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $parent_guid = notags(XML::unescape($data->parent_guid));
+ $text = XML::unescape($data->text);
if (isset($data->created_at)) {
if (isset($data->created_at)) {
- $created_at = DateTimeFormat::utc(notags(XML::unxmlify($data->created_at)));
+ $created_at = DateTimeFormat::utc(notags(XML::unescape($data->created_at)));
} else {
$created_at = DateTimeFormat::utcNow();
}
if (isset($data->thread_parent_guid)) {
} else {
$created_at = DateTimeFormat::utcNow();
}
if (isset($data->thread_parent_guid)) {
- $thread_parent_guid = notags(XML::unxmlify($data->thread_parent_guid));
+ $thread_parent_guid = notags(XML::unescape($data->thread_parent_guid));
$thr_uri = self::getUriFromGuid("", $thread_parent_guid, true);
} else {
$thr_uri = "";
$thr_uri = self::getUriFromGuid("", $thread_parent_guid, true);
} else {
$thr_uri = "";
*/
private static function receiveConversationMessage(array $importer, array $contact, $data, $msg, $mesg, $conversation)
{
*/
private static function receiveConversationMessage(array $importer, array $contact, $data, $msg, $mesg, $conversation)
{
- $author = notags(XML::unxmlify($data->author));
- $guid = notags(XML::unxmlify($data->guid));
- $subject = notags(XML::unxmlify($data->subject));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $subject = notags(XML::unescape($data->subject));
// "diaspora_handle" is the element name from the old version
// "author" is the element name from the new version
if ($mesg->author) {
// "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(XML::unxmlify($mesg->author));
+ $msg_author = notags(XML::unescape($mesg->author));
} elseif ($mesg->diaspora_handle) {
} elseif ($mesg->diaspora_handle) {
- $msg_author = notags(XML::unxmlify($mesg->diaspora_handle));
+ $msg_author = notags(XML::unescape($mesg->diaspora_handle));
- $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)));
+ $msg_guid = notags(XML::unescape($mesg->guid));
+ $msg_conversation_guid = notags(XML::unescape($mesg->conversation_guid));
+ $msg_text = XML::unescape($mesg->text);
+ $msg_created_at = DateTimeFormat::utc(notags(XML::unescape($mesg->created_at)));
if ($msg_conversation_guid != $guid) {
Logger::log("message conversation guid does not belong to the current conversation.");
if ($msg_conversation_guid != $guid) {
Logger::log("message conversation guid does not belong to the current conversation.");
*/
private static function receiveConversation(array $importer, $msg, $data)
{
*/
private static function receiveConversation(array $importer, $msg, $data)
{
- $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));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $subject = notags(XML::unescape($data->subject));
+ $created_at = DateTimeFormat::utc(notags(XML::unescape($data->created_at)));
+ $participants = notags(XML::unescape($data->participants));
$messages = $data->message;
$messages = $data->message;
*/
private static function receiveLike(array $importer, $sender, $data)
{
*/
private static function receiveLike(array $importer, $sender, $data)
{
- $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));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $parent_guid = notags(XML::unescape($data->parent_guid));
+ $parent_type = notags(XML::unescape($data->parent_type));
+ $positive = notags(XML::unescape($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.
// 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.
*/
private static function receiveMessage(array $importer, $data)
{
*/
private static function receiveMessage(array $importer, $data)
{
- $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)));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $conversation_guid = notags(XML::unescape($data->conversation_guid));
+ $text = XML::unescape($data->text);
+ $created_at = DateTimeFormat::utc(notags(XML::unescape($data->created_at)));
$contact = self::allowedContactByHandle($importer, $author, true);
if (!$contact) {
$contact = self::allowedContactByHandle($importer, $author, true);
if (!$contact) {
*/
private static function receiveParticipation(array $importer, $data)
{
*/
private static function receiveParticipation(array $importer, $data)
{
- $author = strtolower(notags(XML::unxmlify($data->author)));
- $parent_guid = notags(XML::unxmlify($data->parent_guid));
+ $author = strtolower(notags(XML::unescape($data->author)));
+ $parent_guid = notags(XML::unescape($data->parent_guid));
$contact_id = Contact::getIdForURL($author);
if (!$contact_id) {
$contact_id = Contact::getIdForURL($author);
if (!$contact_id) {
*/
private static function receiveProfile(array $importer, $data)
{
*/
private static function receiveProfile(array $importer, $data)
{
- $author = strtolower(notags(XML::unxmlify($data->author)));
+ $author = strtolower(notags(XML::unescape($data->author)));
$contact = self::contactByHandle($importer["uid"], $author);
if (!$contact) {
return false;
}
$contact = self::contactByHandle($importer["uid"], $author);
if (!$contact) {
return false;
}
- $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);
+ $name = XML::unescape($data->first_name).((strlen($data->last_name)) ? " ".XML::unescape($data->last_name) : "");
+ $image_url = XML::unescape($data->image_url);
+ $birthday = XML::unescape($data->birthday);
+ $gender = XML::unescape($data->gender);
+ $about = Markdown::toBBCode(XML::unescape($data->bio));
+ $location = Markdown::toBBCode(XML::unescape($data->location));
+ $searchable = (XML::unescape($data->searchable) == "true");
+ $nsfw = (XML::unescape($data->nsfw) == "true");
+ $tags = XML::unescape($data->tag_string);
$tags = explode("#", $tags);
$tags = explode("#", $tags);
*/
private static function receiveContactRequest(array $importer, $data)
{
*/
private static function receiveContactRequest(array $importer, $data)
{
- $author = XML::unxmlify($data->author);
- $recipient = XML::unxmlify($data->recipient);
+ $author = XML::unescape($data->author);
+ $recipient = XML::unescape($data->recipient);
if (!$author || !$recipient) {
return false;
if (!$author || !$recipient) {
return false;
// the current protocol version doesn't know these fields
// That means that we will assume their existance
if (isset($data->following)) {
// the current protocol version doesn't know these fields
// That means that we will assume their existance
if (isset($data->following)) {
- $following = (XML::unxmlify($data->following) == "true");
+ $following = (XML::unescape($data->following) == "true");
} else {
$following = true;
}
if (isset($data->sharing)) {
} else {
$following = true;
}
if (isset($data->sharing)) {
- $sharing = (XML::unxmlify($data->sharing) == "true");
+ $sharing = (XML::unescape($data->sharing) == "true");
} else {
$sharing = true;
}
} else {
$sharing = true;
}
*/
private static function receiveReshare(array $importer, $data, $xml)
{
*/
private static function receiveReshare(array $importer, $data, $xml)
{
- $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));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $created_at = DateTimeFormat::utc(notags(XML::unescape($data->created_at)));
+ $root_author = notags(XML::unescape($data->root_author));
+ $root_guid = notags(XML::unescape($data->root_guid));
/// @todo handle unprocessed property "provider_display_name"
/// @todo handle unprocessed property "provider_display_name"
- $public = notags(XML::unxmlify($data->public));
+ $public = notags(XML::unescape($data->public));
$contact = self::allowedContactByHandle($importer, $author, false);
if (!$contact) {
$contact = self::allowedContactByHandle($importer, $author, false);
if (!$contact) {
*/
private static function itemRetraction(array $importer, array $contact, $data)
{
*/
private static function itemRetraction(array $importer, array $contact, $data)
{
- $author = notags(XML::unxmlify($data->author));
- $target_guid = notags(XML::unxmlify($data->target_guid));
- $target_type = notags(XML::unxmlify($data->target_type));
+ $author = notags(XML::unescape($data->author));
+ $target_guid = notags(XML::unescape($data->target_guid));
+ $target_type = notags(XML::unescape($data->target_type));
$person = self::personByHandle($author);
if (!is_array($person)) {
$person = self::personByHandle($author);
if (!is_array($person)) {
*/
private static function receiveRetraction(array $importer, $sender, $data)
{
*/
private static function receiveRetraction(array $importer, $sender, $data)
{
- $target_type = notags(XML::unxmlify($data->target_type));
+ $target_type = notags(XML::unescape($data->target_type));
$contact = self::contactByHandle($importer["uid"], $sender);
if (!$contact && (in_array($target_type, ["Contact", "Person"]))) {
$contact = self::contactByHandle($importer["uid"], $sender);
if (!$contact && (in_array($target_type, ["Contact", "Person"]))) {
*/
private static function receiveStatusMessage(array $importer, SimpleXMLElement $data, $xml)
{
*/
private static function receiveStatusMessage(array $importer, SimpleXMLElement $data, $xml)
{
- $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));
+ $author = notags(XML::unescape($data->author));
+ $guid = notags(XML::unescape($data->guid));
+ $created_at = DateTimeFormat::utc(notags(XML::unescape($data->created_at)));
+ $public = notags(XML::unescape($data->public));
+ $text = XML::unescape($data->text);
+ $provider_display_name = notags(XML::unescape($data->provider_display_name));
$contact = self::allowedContactByHandle($importer, $author, false);
if (!$contact) {
$contact = self::allowedContactByHandle($importer, $author, false);
if (!$contact) {
$address = [];
if ($data->location) {
foreach ($data->location->children() as $fieldname => $data) {
$address = [];
if ($data->location) {
foreach ($data->location->children() as $fieldname => $data) {
- $address[$fieldname] = notags(XML::unxmlify($data));
+ $address[$fieldname] = notags(XML::unescape($data));
// Attach embedded pictures to the body
if ($data->photo) {
foreach ($data->photo as $photo) {
// Attach embedded pictures to the body
if ($data->photo) {
foreach ($data->photo as $photo) {
- $body = "[img]".XML::unxmlify($photo->remote_photo_path).
- XML::unxmlify($photo->remote_photo_name)."[/img]\n".$body;
+ $body = "[img]".XML::unescape($photo->remote_photo_path).
+ XML::unescape($photo->remote_photo_name)."[/img]\n".$body;
}
$datarray["object-type"] = ACTIVITY_OBJ_IMAGE;
}
$datarray["object-type"] = ACTIVITY_OBJ_IMAGE;