From e6ce4b63f4f8ca27757a1ba2a5cc1d9c963607b3 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sat, 21 Sep 2013 21:18:20 +0000 Subject: [PATCH] * make sure we don't clean up relative paths ../ or ./ by mistake --- source/net/sourceforge/tuned/FileUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/sourceforge/tuned/FileUtilities.java b/source/net/sourceforge/tuned/FileUtilities.java index e32264a4..aa103138 100644 --- a/source/net/sourceforge/tuned/FileUtilities.java +++ b/source/net/sourceforge/tuned/FileUtilities.java @@ -456,7 +456,7 @@ public final class FileUtilities { /** * Invalid file name characters: \, /, :, *, ?, ", <, >, |, \r and \n */ - public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[. ]+$"); + public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[ ]+$|(?<=[^.])[.]+$"); /** * Strip file name of invalid characters