From 2b772b76c3d9f06f6cd9e02965529f093218b085 Mon Sep 17 00:00:00 2001 From: Alphastaire Date: Fri, 16 Aug 2024 17:56:55 -0700 Subject: [PATCH] Platform-specific sanitize logic Sanitize logic now works differently depending on the platform, including new support for Linux. --- libdino/src/service/file_manager.vala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libdino/src/service/file_manager.vala b/libdino/src/service/file_manager.vala index 4d5d378df..d34a50cc8 100644 --- a/libdino/src/service/file_manager.vala +++ b/libdino/src/service/file_manager.vala @@ -46,9 +46,12 @@ public class FileManager : StreamInteractionModule, Object { return ret; } - // Required to allow Windows users to receive files with illegal characters in name private string sanitize_filename(string filename) { +#if _WIN32 GLib.Regex regex = new GLib.Regex("[<>:\"/\\|?*]"); +#else + GLib.Regex regex = new GLib.Regex("[\/\x00]"); +#endif return regex.replace(filename, -1, 0, "_"); }