From 6613ebe67dd482aec297de8880f5a5bc86c09541 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 5 Jun 2014 02:48:40 +0000 Subject: [PATCH] * fix excessively long filenames --- source/net/filebot/util/FileUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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