first basic protection - #524
This commit is contained in:
@@ -627,6 +627,14 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||
userHost: user.host,
|
||||
});
|
||||
|
||||
// should really not happen, but better safe than sorry
|
||||
if (data.reply?.id === insert.id) {
|
||||
throw new Error("A note can't reply to itself");
|
||||
}
|
||||
if (data.renote?.id === insert.id) {
|
||||
throw new Error("A note can't renote itself");
|
||||
}
|
||||
|
||||
if (data.uri != null) insert.uri = data.uri;
|
||||
if (data.url != null) insert.url = data.url;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user