]> git.mxchange.org Git - friendica.git/commitdiff
Add missing author contact in ActivityPub\Processor
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 24 Feb 2019 20:48:56 +0000 (15:48 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sun, 24 Feb 2019 20:52:03 +0000 (15:52 -0500)
- Add logging for future occurrences
- Addresses https://github.com/friendica/friendica/issues/6338#issuecomment-466812104

src/Protocol/ActivityPub/Processor.php

index 2661444e0c56e34ac94ecd1df2351d5c64a9626d..e5ef354ba245097a73e3c1fdd1635ddaef7f3313 100644 (file)
@@ -669,13 +669,16 @@ class Processor
 
                $parent_author = Contact::getDetailsByURL($parent['author-link'], 0);
 
-               $implicit_mentions = [
-                       $parent_author['url'],
-                       $parent_author['nurl'],
-                       $parent_author['alias'],
-               ];
+               $implicit_mentions = [];
+               if (empty($parent_author)) {
+                       Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]);
+               }else {
+                       $implicit_mentions[] = $parent_author['url'];
+                       $implicit_mentions[] = $parent_author['nurl'];
+                       $implicit_mentions[] = $parent_author['alias'];
+               }
 
-               if ($parent['alias']) {
+               if (!empty($parent['alias'])) {
                        $implicit_mentions[] = $parent['alias'];
                }