From 9c1437bdf95da9ad2ae161814658f8a5ae627043 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 19 Feb 2024 14:27:10 +0000 Subject: [PATCH] check prohibited words when editing note --- packages/backend/src/core/NoteEditService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index c0d17fc7ac..b137295b0b 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -275,6 +275,10 @@ export class NoteEditService implements OnApplicationShutdown { } } + if (this.utilityService.isKeyWordIncluded(data.cw ?? data.text ?? '', meta.prohibitedWords)) { + throw new NoteEditService.ContainsProhibitedWordsError(); + } + const inSilencedInstance = this.utilityService.isSilencedHost((meta).silencedHosts, user.host); if (data.visibility === 'public' && inSilencedInstance && user.host !== null) {