aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIngo Bauersachs <ingo@jitsi.org>2016-07-16 15:20:17 +0200
committerIngo Bauersachs <ingo@jitsi.org>2016-07-16 15:20:17 +0200
commit236849354a2f334edbb2254a0501a76359309043 (patch)
treeaf6a54fe51ff66c709b818c5f63851ee5592ffde /src
parent1e68317fd95bacab8112a71e7e41cc7cfa105325 (diff)
downloadjitsi-236849354a2f334edbb2254a0501a76359309043.zip
jitsi-236849354a2f334edbb2254a0501a76359309043.tar.gz
jitsi-236849354a2f334edbb2254a0501a76359309043.tar.bz2
Strip invalid characters when receiving a file
Closes #156
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/gui/main/chat/filetransfer/ReceiveFileConversationComponent.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/chat/filetransfer/ReceiveFileConversationComponent.java b/src/net/java/sip/communicator/impl/gui/main/chat/filetransfer/ReceiveFileConversationComponent.java
index ef72a89..f5a698b 100644
--- a/src/net/java/sip/communicator/impl/gui/main/chat/filetransfer/ReceiveFileConversationComponent.java
+++ b/src/net/java/sip/communicator/impl/gui/main/chat/filetransfer/ReceiveFileConversationComponent.java
@@ -164,6 +164,10 @@ public class ReceiveFileConversationComponent
File downloadDir = null;
String incomingFileName = fileTransferRequest.getFileName();
+ // strip characters that are invalid on Windows and maybe other
+ // platforms too
+ incomingFileName = incomingFileName
+ .replaceAll("[\\\\/:*?\"<>|]", "_");
try
{
downloadDir = GuiActivator.getFileAccessService()