Issue #314 Better name to filename conversion

This commit is contained in:
Jindra Petk
2013-08-10 20:31:25 +02:00
parent fa57806f5b
commit 0a7e281dea

View File

@@ -436,6 +436,12 @@ public class Helper {
}
}
str = sb.toString();
if (str.endsWith(" ")) {
str = str.substring(0, str.length() - 1) + "%20";
}
if (str.endsWith(".")) {
str = str.substring(0, str.length() - 1) + "%2E";
}
str = "." + str + ".";
for (String inv : invalidFilenamesParts) {
str = Pattern.compile("\\." + Pattern.quote(inv) + "\\.", Pattern.CASE_INSENSITIVE).matcher(str).replaceAll("._" + inv + ".");