This commit is contained in:
Dejan Bosanac 2015-05-05 16:29:26 +02:00 committed by Daniel Kulp
parent 9fd5cb7dfe
commit 729c473157
1 changed files with 3 additions and 1 deletions

View File

@ -17,6 +17,7 @@
package org.apache.activemq.util;
import java.io.IOException;
import java.nio.file.FileSystems;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@ -60,7 +61,8 @@ public class FilenameGuardFilter implements Filter {
}
private String guard(String filename) {
String guarded = filename.replace(":", "_").replace("\\", "").replace("/", "");
String guarded = filename.replace(":", "_");
guarded = FileSystems.getDefault().getPath(guarded).normalize().toString();
if (LOG.isDebugEnabled()) {
LOG.debug("guarded " + filename + " to " + guarded);
}