From c44d9b7f874b07ce309a1fac937ff56f24383fee Mon Sep 17 00:00:00 2001 From: vibe-bot Date: Sat, 9 Aug 2025 15:57:18 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20UTF-8=20Support=20f=C3=BCr=20Datei-Umben?= =?UTF-8?q?ennung=20-=20Leerzeichen=20und=20Umlaute=20(=C3=A4=C3=B6=C3=BC)?= =?UTF-8?q?=20jetzt=20erlaubt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/index.ts b/server/src/index.ts index 550e600..8abbf67 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -514,7 +514,9 @@ app.post('/api/admin/sounds/rename', requireAdmin, (req: Request, res: Response) const src = path.join(SOUNDS_DIR, from); // Ziel nur Name ändern, Endung mp3 sicherstellen const parsed = path.parse(from); - const dstRel = path.join(parsed.dir || '', `${to.replace(/[^a-zA-Z0-9_.\-]/g, '_')}.mp3`); + // UTF-8 Zeichen erlauben: Leerzeichen, Umlaute, etc. - nur problematische Zeichen filtern + const sanitizedName = to.replace(/[<>:"/\\|?*\x00-\x1f]/g, '_'); + const dstRel = path.join(parsed.dir || '', `${sanitizedName}.mp3`); const dst = path.join(SOUNDS_DIR, dstRel); try { if (!fs.existsSync(src)) return res.status(404).json({ error: 'Quelle nicht gefunden' });