]> git.mxchange.org Git - friendica.git/commitdiff
Use atom:author/atom:uri as profile-link in Feed::import
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Nov 2018 13:24:10 +0000 (08:24 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Nov 2018 13:24:10 +0000 (08:24 -0500)
- Use atom:author/atom:id as profile-id

src/Protocol/Feed.php

index 71ebe5506b9dadd78587e6123646af464d9c2d5f..d63b57b8c9522bd6a21d9387b1c7e0c93a217e50 100644 (file)
@@ -123,7 +123,13 @@ class Feed {
                                $author["author-name"] = $value;
                        }
                        if ($simulate) {
-                               $author["author-id"] = XML::getFirstNodeValue($xpath, '/atom:feed/atom:author/atom:uri/text()');
+                               $author["author-id"] = XML::getFirstNodeValue($xpath, '/atom:feed/atom:author/atom:id/text()');
+
+                               // See https://tools.ietf.org/html/rfc4287#section-3.2.2
+                               $value = XML::getFirstNodeValue($xpath, 'atom:author/atom:uri/text()');
+                               if ($value != "") {
+                                       $author["author-link"] = $value;
+                               }
 
                                $value = XML::getFirstNodeValue($xpath, 'atom:author/poco:preferredUsername/text()');
                                if ($value != "") {