fix(backend): drive/files/updateにおけるファイル名のバリデーションが機能していない問題を修正 (#12923)

* fix(backend): `drive/files/update`におけるファイル名のバリデーションが機能していない問題を修正

* Update CHANGELOG.md

* refactor: `!== undefined` -> `!= null`

* add test
This commit is contained in:
zyoshoka 2024-01-08 17:40:37 +09:00 committed by GitHub
parent 04f9147db6
commit 618e2ba1d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -655,7 +655,7 @@ export class DriveService {
public async updateFile(file: MiDriveFile, values: Partial<MiDriveFile>, updater: MiUser) {
const alwaysMarkNsfw = (await this.roleService.getUserPolicies(file.userId)).alwaysMarkNsfw;
if (values.name && !this.driveFileEntityService.validateFileName(file.name)) {
if (values.name != null && !this.driveFileEntityService.validateFileName(values.name)) {
throw new DriveService.InvalidFileNameError();
}