Add item user owner data check in Model\Item::isValid
- Prevents deleted users from posting any item, manually or automatically through mirroring
This commit is contained in:
parent
8c17a6b4d9
commit
0951a50bcd
|
@ -1385,6 +1385,19 @@ class Item
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($item['uid'])) {
|
||||||
|
$owner = User::getOwnerDataById($item['uid'], false);
|
||||||
|
if (!$owner) {
|
||||||
|
Logger::notice('Missing item user owner data', ['uid' => $item['uid']]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($owner['deleted'] || $owner['account_expired'] || $owner['account_removed']) {
|
||||||
|
Logger::notice('Item user has been deleted/expired/removed', ['uid' => $item['uid'], 'deleted' => $owner['deleted'], 'account_expired' => $owner['account_expired'], 'account_removed' => $owner['account_removed']]);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($item['author-id']) && Contact::isBlocked($item['author-id'])) {
|
if (!empty($item['author-id']) && Contact::isBlocked($item['author-id'])) {
|
||||||
Logger::notice('Author is blocked node-wide', ['author-link' => $item['author-link'], 'item-uri' => $item['uri']]);
|
Logger::notice('Author is blocked node-wide', ['author-link' => $item['author-link'], 'item-uri' => $item['uri']]);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue