]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Transmitter.php
Merge pull request #11305 from annando/api-spoiler
[friendica.git] / src / Protocol / ActivityPub / Transmitter.php
index 0e16884b40721318d496d0f92543f0154a57a530..47c3cdaab5d1a3f40465d2dc1a7857c3d818c0ae 100644 (file)
@@ -702,13 +702,15 @@ class Transmitter
                }
 
                foreach (['to' => Tag::TO, 'cc' => Tag::CC, 'bcc' => Tag::BCC] as $element => $type) {
-                       foreach ($receivers[$element] as $receiver) {
-                               if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
-                                       $name = Receiver::PUBLIC_COLLECTION;
-                               } else {
-                                       $name = trim(parse_url($receiver, PHP_URL_PATH), '/');
+                       if (!empty($receivers[$element])) {
+                               foreach ($receivers[$element] as $receiver) {
+                                       if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
+                                               $name = Receiver::PUBLIC_COLLECTION;
+                                       } else {
+                                               $name = trim(parse_url($receiver, PHP_URL_PATH), '/');
+                                       }
+                                       Tag::store($item['uri-id'], $type, $name, $receiver);
                                }
-                               Tag::store($item['uri-id'], $type, $name, $receiver);
                        }
                }
 
@@ -909,6 +911,7 @@ class Transmitter
                        $mail['title']        = '';
                }
 
+               $mail['content-warning']  = '';
                $mail['author-link']      = $mail['owner-link'] = $mail['from-url'];
                $mail['owner-id']         = $mail['author-id'];
                $mail['allow_cid']        = '<'.$mail['contact-id'].'>';