1
1
Fork 0

Merge pull request #10324 from annando/issue-10262

Issue 10262: Don't accept BCC posts from non followers
This commit is contained in:
Hypolite Petovan 2021-05-27 11:40:14 -04:00 committed by GitHub
commit 7af91bafec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -602,6 +602,12 @@ class Processor
continue; continue;
} }
if (!$item['isForum'] && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT) &&
($item['post-reason'] == Item::PR_BCC) && !Contact::isSharingByURL($activity['author'], $receiver)) {
Logger::info('Top level post via BCC from a non sharer, ignoring', ['uid' => $receiver, 'contact' => $item['contact-id']]);
continue;
}
if (DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) { if (DI::pConfig()->get($receiver, 'system', 'accept_only_sharer', false) && ($receiver != 0) && ($item['gravity'] == GRAVITY_PARENT)) {
$skip = !Contact::isSharingByURL($activity['author'], $receiver); $skip = !Contact::isSharingByURL($activity['author'], $receiver);