diff --git a/source/net/filebot/util/FileUtilities.java b/source/net/filebot/util/FileUtilities.java index 4eaf79b9..b2ae332f 100644 --- a/source/net/filebot/util/FileUtilities.java +++ b/source/net/filebot/util/FileUtilities.java @@ -479,9 +479,9 @@ public final class FileUtilities { } /** - * Invalid file name characters: \, /, :, *, ?, ", <, >, |, \r and \n + * Invalid file name characters: \, /, :, *, ?, ", <, >, |, \r, \n and excessive characters */ - public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[ ]+$|(?<=[^.])[.]+$"); + public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[ ]+$|(?<=[^.])[.]+$|(?<=.{250})(.+)(?=[.]\\p{Alnum}{3}$)"); /** * Strip file name of invalid characters