mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
unrecogonized characters patterns replaced with underscore
This commit is contained in:
@@ -66,6 +66,7 @@ import org.alfresco.util.TempFileProvider;
|
|||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||||
import org.apache.commons.compress.utils.InputStreamStatistics;
|
import org.apache.commons.compress.utils.InputStreamStatistics;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -261,7 +262,7 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.info("Encoding after: "+encoding);
|
logger.info("Encoding after: "+encoding);
|
||||||
zipFile = new ZipFile(tempFile, encoding, true);
|
zipFile = new ZipFile(tempFile, encoding, false);
|
||||||
// build a temp dir name based on the ID of the noderef we are importing
|
// build a temp dir name based on the ID of the noderef we are importing
|
||||||
// also use the long life temp folder as large ZIP files can take a while
|
// also use the long life temp folder as large ZIP files can take a while
|
||||||
File alfTempDir = TempFileProvider.getLongLifeTempDir("import");
|
File alfTempDir = TempFileProvider.getLongLifeTempDir("import");
|
||||||
@@ -414,7 +415,8 @@ public class ImporterActionExecuter extends ActionExecuterAbstractBase
|
|||||||
ZipArchiveEntry entry = e.nextElement();
|
ZipArchiveEntry entry = e.nextElement();
|
||||||
if (!entry.isDirectory())
|
if (!entry.isDirectory())
|
||||||
{
|
{
|
||||||
fileName = entry.getName();
|
fileName = entry.getName().replaceAll("\\?","_");
|
||||||
|
fileName = StringUtils.stripAccents(fileName);
|
||||||
fileName = fileName.replace('/', File.separatorChar);
|
fileName = fileName.replace('/', File.separatorChar);
|
||||||
|
|
||||||
if (fileName.startsWith("/") || fileName.indexOf(":" + File.separator) == 1 || fileName.contains(".." + File.separator))
|
if (fileName.startsWith("/") || fileName.indexOf(":" + File.separator) == 1 || fileName.contains(".." + File.separator))
|
||||||
|
Reference in New Issue
Block a user