Skip to content

Commit

Permalink
Platform-specific sanitize logic
Browse files Browse the repository at this point in the history
Sanitize logic now works differently depending on the platform, including new support for Linux.
  • Loading branch information
Alphastaire committed Aug 17, 2024
1 parent 1fc9997 commit 354d81d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libdino/src/service/file_manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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, "_");
}

Expand Down

0 comments on commit 354d81d

Please sign in to comment.