Skip to content

Commit 46a5185

Browse files
committed
Sanitize filename input
1 parent 96f4a2e commit 46a5185

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

static/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function sanitizeFilename(filename) {
279279
// Remove leading/trailing whitespace
280280
filename = filename.trim();
281281
// Replace spaces and dots with underscores
282-
filename = filename.replace(/[\s.]+/g, '_');
282+
filename = filename.replace(/[^A-Za-z0-9_-]/g, '_');
283283
return filename;
284284
}
285285

0 commit comments

Comments
 (0)