X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffeed.php;h=15e5f65366d939d7f351a5a3b4fe09e292b6a151;hb=3a9a9e6a1c07c253bfbe6d437d1311497e947086;hp=04cfba75a69fc407cf610725e26a70a832d843a2;hpb=f9e2543133bec4775b70c45da56da1b642464aff;p=friendica.git diff --git a/include/feed.php b/include/feed.php index 04cfba75a6..15e5f65366 100644 --- a/include/feed.php +++ b/include/feed.php @@ -47,15 +47,17 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { } // Is it Atom? - if ($xpath->query('/atom:feed/atom:entry')->length > 0) { + if ($xpath->query('/atom:feed')->length > 0) { $alternate = $xpath->query("atom:link[@rel='alternate']")->item(0)->attributes; if (is_object($alternate)) foreach($alternate AS $attributes) if ($attributes->name == "href") $author["author-link"] = $attributes->textContent; + $author["author-id"] = $xpath->evaluate('/atom:feed/atom:author/atom:uri/text()')->item(0)->nodeValue; + if ($author["author-link"] == "") - $author["author-link"] = $xpath->evaluate('/atom:feed/atom:author/atom:uri/text()')->item(0)->nodeValue; + $author["author-link"] = $author["author-id"]; if ($author["author-link"] == "") { $self = $xpath->query("atom:link[@rel='self']")->item(0)->attributes; @@ -127,6 +129,7 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { // This is no field in the item table. So we have to unset it. unset($author["author-nick"]); + unset($author["author-id"]); } $header = array();