Add empty entry author if contact query fails in DFRN
- Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-462722599
This commit is contained in:
@@ -763,9 +763,10 @@ class DFRN
|
|||||||
*/
|
*/
|
||||||
private static function addEntryAuthor(DOMDocument $doc, $element, $contact_url, $item)
|
private static function addEntryAuthor(DOMDocument $doc, $element, $contact_url, $item)
|
||||||
{
|
{
|
||||||
$contact = Contact::getDetailsByURL($contact_url, $item["uid"]);
|
|
||||||
|
|
||||||
$author = $doc->createElement($element);
|
$author = $doc->createElement($element);
|
||||||
|
|
||||||
|
$contact = Contact::getDetailsByURL($contact_url, $item["uid"]);
|
||||||
|
if (!empty($contact)) {
|
||||||
XML::addElement($doc, $author, "name", $contact["name"]);
|
XML::addElement($doc, $author, "name", $contact["name"]);
|
||||||
XML::addElement($doc, $author, "uri", $contact["url"]);
|
XML::addElement($doc, $author, "uri", $contact["url"]);
|
||||||
XML::addElement($doc, $author, "dfrn:handle", $contact["addr"]);
|
XML::addElement($doc, $author, "dfrn:handle", $contact["addr"]);
|
||||||
@@ -788,6 +789,7 @@ class DFRN
|
|||||||
"media:height" => 80,
|
"media:height" => 80,
|
||||||
"href" => $contact["photo"]];
|
"href" => $contact["photo"]];
|
||||||
XML::addElement($doc, $author, "link", "", $attributes);
|
XML::addElement($doc, $author, "link", "", $attributes);
|
||||||
|
}
|
||||||
|
|
||||||
return $author;
|
return $author;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user