diff options
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java b/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java index b5ac2742d..913e28c17 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java +++ b/src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java @@ -244,6 +244,11 @@ public class BluetoothOppReceiveFileInfo { // Prevent abuse of path backslashes by converting all backlashes '\\' chars // to UNIX-style forward-slashes '/' hint = hint.replace('\\', '/'); + // Convert all whitespace characters to spaces. + hint = hint.replaceAll("\\s", " "); + // Replace illegal fat filesystem characters from the + // filename hint i.e. :"<>*?| with something safe. + hint = hint.replaceAll("[:\"<>*?|]", "_"); if (V) Log.v(Constants.TAG, "getting filename from hint"); int index = hint.lastIndexOf('/') + 1; if (index > 0) { |