mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-06 19:07:08 +02:00
fix: #14185, assert note if Like received to a post that doesn't already exist
This commit is contained in:
@@ -338,9 +338,16 @@ inbox.like = async (req) => {
|
||||
exists = await posts.exists(_id);
|
||||
id = _id;
|
||||
}
|
||||
|
||||
} else {
|
||||
exists = await posts.exists(object.id);
|
||||
if (!exists) {
|
||||
// Proactively pull in the note
|
||||
const asserted = await activitypub.notes.assert(0, object.id, { skipChecks: 1 });
|
||||
if (!asserted) {
|
||||
throw new Error('[[error:invalid-pid]]');
|
||||
}
|
||||
exists = true;
|
||||
}
|
||||
id = object.id;
|
||||
}
|
||||
if (!id || !exists) {
|
||||
|
||||
Reference in New Issue
Block a user