This commit is contained in:
Dejan Bosanac 2015-05-05 16:29:26 +02:00
parent 30210ae191
commit f8e778ea98
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);
}