Merge pull request #2327 from annando/1602-dfrn-poke
DFRN: Sending pokes does work now again
This commit is contained in:
commit
7001a231e4
1 changed files with 17 additions and 9 deletions
|
@ -634,14 +634,21 @@ class dfrn {
|
||||||
|
|
||||||
$r->link = preg_replace('/\<link(.*?)\"\>/','<link$1"/>',$r->link);
|
$r->link = preg_replace('/\<link(.*?)\"\>/','<link$1"/>',$r->link);
|
||||||
|
|
||||||
$data = parse_xml_string($r->link, false);
|
// XML does need a single element as root element so we add a dummy element here
|
||||||
foreach ($data->attributes() AS $parameter => $value)
|
$data = parse_xml_string("<dummy>".$r->link."</dummy>", false);
|
||||||
|
if (is_object($data)) {
|
||||||
|
foreach ($data->link AS $link) {
|
||||||
|
$attributes = array();
|
||||||
|
foreach ($link->attributes() AS $parameter => $value)
|
||||||
$attributes[$parameter] = $value;
|
$attributes[$parameter] = $value;
|
||||||
} else
|
|
||||||
$attributes = array("rel" => "alternate", "type" => "text/html", "href" => $r->link);
|
|
||||||
|
|
||||||
xml_add_element($doc, $entry, "link", "", $attributes);
|
xml_add_element($doc, $entry, "link", "", $attributes);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$attributes = array("rel" => "alternate", "type" => "text/html", "href" => $r->link);
|
||||||
|
xml_add_element($doc, $entry, "link", "", $attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
if($r->content)
|
if($r->content)
|
||||||
xml_add_element($doc, $entry, "content", bbcode($r->content), array("type" => "html"));
|
xml_add_element($doc, $entry, "content", bbcode($r->content), array("type" => "html"));
|
||||||
|
|
||||||
|
@ -1311,8 +1318,9 @@ class dfrn {
|
||||||
if (is_object($title))
|
if (is_object($title))
|
||||||
$obj_element->appendChild($obj_doc->importNode($title, true));
|
$obj_element->appendChild($obj_doc->importNode($title, true));
|
||||||
|
|
||||||
$link = $xpath->query("atom:link", $activity)->item(0);
|
$links = $xpath->query("atom:link", $activity);
|
||||||
if (is_object($link))
|
if (is_object($links))
|
||||||
|
foreach ($links AS $link)
|
||||||
$obj_element->appendChild($obj_doc->importNode($link, true));
|
$obj_element->appendChild($obj_doc->importNode($link, true));
|
||||||
|
|
||||||
$content = $xpath->query("atom:content", $activity)->item(0);
|
$content = $xpath->query("atom:content", $activity)->item(0);
|
||||||
|
|
Loading…
Reference in a new issue