Peter Centgraf pushed to branch feature/CMS-11074 at cms-community / 
hippo-cms-commons


Commits:
5fce79c4 by Peter Centgraf at 2018-02-14T13:22:02+01:00
CMS-11074 Fix refactoring error (regexp entity range != char list, duh...)

- - - - -


1 changed file:

- src/main/java/org/onehippo/cms7/util/FilePathUtils.java


Changes:

=====================================
src/main/java/org/onehippo/cms7/util/FilePathUtils.java
=====================================
--- a/src/main/java/org/onehippo/cms7/util/FilePathUtils.java
+++ b/src/main/java/org/onehippo/cms7/util/FilePathUtils.java
@@ -45,8 +45,9 @@ public class FilePathUtils {
      */
     public static String cleanFileName(String name) {
         // step 1, replace naughty chars
-        name = 
CharMatcher.anyOf("[\\x00-\\x20<>:;\"/|?*\\\\]\t\n\u000B\f\n").trimAndCollapseFrom(name,
 '-');
-        name = CharMatcher.anyOf("-. ").trimFrom(name);
+        name = name.replaceAll("[\\x00-\\x20<>:;\"/|?*\\\\]", "-");
+        name = CharMatcher.anyOf("-\t\n\u000B\f\r").trimAndCollapseFrom(name, 
'-');
+        name = CharMatcher.anyOf(".-").trimFrom(name);
         switch (name) {
             case "CON":
             case "PRN":



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-cms-commons/commit/5fce79c4bfa0a4448605a47705e3445f3c47265f

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-cms-commons/commit/5fce79c4bfa0a4448605a47705e3445f3c47265f
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to