Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
-> Fixes issue #1063 #1180 #1101 (And possibly more but I couldn't find)
Description
As discussed in issue #1063 there currently is an error if a file is sent on a device with a different system of the sender. This is due to different character limitations in files' names depending on Operating systems and partitions. For example:
On my Linux computer I can create the file
<cool>.txt
and send it to my other linux computer without issue. But if I try to send it to my Windows computer or to my Android phone, LocalSend will fail to save the file and fail the transfer with error code 500. This is because<>
are illegal characters on Windows and FAT32 devices (Android).This PR fixes that issue by providing a sanitization step before saving a file. Like here:
The sanitization is handled by the legalize library that I made for the occasion. So if any issues like this open up, they can be addressed upstream here instead. I'd be glad if users could test it across the many different OS they possess, I couldn't test it directly on all the possible different systems.
Changes
legalize: 1.2.1
dependencydigestFilePathAndPrepareDirectory
functionFileNameInputDialog
andQuickActionsDialog
widgets