mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-5754 - better filename guaard fix
This commit is contained in:
parent
9fd5cb7dfe
commit
729c473157
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue