v1.3.9: 받아오기 — 표시 이름에 '..' 이 든 녹음 파일 이름도 받는다 (폴더 구분자만 막음)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-16 06:02:36 +09:00
parent 6a32bedfe3
commit 55ec58f343
6 changed files with 70 additions and 9 deletions

View File

@@ -438,7 +438,9 @@ export function validate(files: Map<string, Buffer>, store?: Store): { manifest:
if (u.match_id && !matchIds.has(u.match_id) && !store?.getMatch(u.match_id)) fail(`발화 ${u.id} 의 경기(${u.match_id})가 없습니다`);
if (u.audio) {
// v1.3.7: audio/<발화ID>.ogg, v1.3.8~: audio/<날짜_시각_말한사람_…_발화ID>.ogg
if (typeof u.audio !== 'string' || !/^audio\/[^/\\]{1,200}\.ogg$/.test(u.audio) || u.audio.includes('..')) fail(`발화 ${u.id} 의 음성 파일 이름이 잘못되었습니다`);
// zip 안 이름은 zip 에서 꺼낼 때 찾는 열쇠로만 쓴다 (이 PC 에 쓸 경로는 발화 ID 로 만든다). 폴더 구분자만 막으면 상위 폴더로 갈 수 없다.
// 이름 안의 ".." (예: 표시 이름 "하늘..별")은 정상 이름이다
if (typeof u.audio !== 'string' || !/^audio\/[^/\\]{1,200}\.ogg$/.test(u.audio)) fail(`발화 ${u.id} 의 음성 파일 이름이 잘못되었습니다`);
if (audioSeen.has(u.audio)) fail(`음성 파일 ${u.audio} 를 두 발화가 같이 씁니다`);
audioSeen.add(u.audio);
const a = files.get(u.audio);