From 354d81d64763577f4cf40058588ff037e09d7bc7 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..c23176e73 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("[/\\x{00}]"); +#endif return regex.replace(filename, -1, 0, "_"); }