From fc4cdecae343e473a108317e60615768877e9e43 Mon Sep 17 00:00:00 2001 From: KanariKanaru <93921745+kanarikanaru@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:29:21 +0900 Subject: [PATCH] =?UTF-8?q?Enhance:=20=E3=83=A2=E3=83=87=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=83=BC=E4=BB=A5=E4=B8=8A=E3=81=AF=E5=88=B6=E9=99=90?= =?UTF-8?q?=E3=81=AE=E5=BD=B1=E9=9F=BF=E3=82=92=E5=8F=97=E3=81=91=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/api/endpoints/i/update.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index d5cd14ae52..4d67a08e14 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -458,7 +458,10 @@ export default class extends Endpoint { // eslint- const newName = updates.name === undefined ? user.name : updates.name; if (newName != null) { - const hasProhibitedWords = this.checkScreennameProhibitedWordsContain(newName, this.instanceMeta.prohibitedPartialScreenNames); + let hasProhibitedWords = false; + if (!await this.roleService.isModerator(user)) { + hasProhibitedWords = this.checkScreennameProhibitedWordsContain(newName, this.instanceMeta.prohibitedPartialScreenNames); + } if (hasProhibitedWords) { throw new ApiError(meta.errors.screenNameContainsProhibitedWords); }