activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5754 - better filename guaard fix
Date Tue, 05 May 2015 14:29:53 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 30210ae19 -> f8e778ea9


https://issues.apache.org/jira/browse/AMQ-5754 - better filename guaard fix


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f8e778ea
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f8e778ea
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f8e778ea

Branch: refs/heads/master
Commit: f8e778ea98c1f6dde7c2ea45541e964e6376ace3
Parents: 30210ae
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Tue May 5 16:29:26 2015 +0200
Committer: Dejan Bosanac <dejan@nighttale.net>
Committed: Tue May 5 16:29:39 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/activemq/util/FilenameGuardFilter.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f8e778ea/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
----------------------------------------------------------------------
diff --git a/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
b/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
index 89bfa58..b8bcc95 100644
--- a/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
+++ b/activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java
@@ -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);
             }


Mime
View raw message