Commit 1653ddaa authored by Piotr Gawron's avatar Piotr Gawron
Browse files

filename cases are preserved in uploaded zip files

parent b978534a
Pipeline #15171 passed with stage
in 11 minutes and 15 seconds
......@@ -20,6 +20,7 @@ minerva (14.0.3) stable; urgency=medium
(below 14.0.0) didn't produce valid SBML (#970)
* Bug fix: fields in add project window are reinitialized after each open
(#963)
* Bug fix: filename case in uploaded zip files is preserved (#964)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 16 Oct 2019 9:00:00 +0200
......
......@@ -1429,22 +1429,23 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) {
if (jsZipEntry.dir) {
return null;
}
var filename = jsZipEntry.name.toLowerCase();
var filename = jsZipEntry.name;
var lowercaseFilename = jsZipEntry.name.toLowerCase();
var type;
var data = {};
var processingPromise = Promise.resolve();
if (this.isIgnoredZipEntry(filename)) {
if (this.isIgnoredZipEntry(lowercaseFilename)) {
type = undefined;
} else if (filename.indexOf("submaps") === 0) {
} else if (lowercaseFilename.indexOf("submaps") === 0) {
type = "MAP";
if (filename.endsWith("mapping.xml")) {
if (lowercaseFilename.endsWith("mapping.xml")) {
data.mapping = true;
}
} else if (filename.indexOf("images") === 0) {
} else if (lowercaseFilename.indexOf("images") === 0) {
type = "IMAGE";
} else if (filename.indexOf("glyphs") === 0) {
} else if (lowercaseFilename.indexOf("glyphs") === 0) {
type = "GLYPH";
} else if (filename.indexOf("layouts") === 0 || filename.indexOf("overlays") === 0) {
} else if (lowercaseFilename.indexOf("layouts") === 0 || lowercaseFilename.indexOf("overlays") === 0) {
type = "OVERLAY";
processingPromise = zipObject.file(jsZipEntry.name).async("string").then(function (content) {
var overlayParser = new OverlayParser();
......@@ -1460,7 +1461,7 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) {
data.description = "";
}
});
} else if (filename.indexOf("\\") === -1 && filename.indexOf("/") === -1) {
} else if (lowercaseFilename.indexOf("\\") === -1 && lowercaseFilename.indexOf("/") === -1) {
type = "MAP";
data.root = true;
} else {
......@@ -1472,7 +1473,7 @@ AddProjectDialog.prototype.createZipEntry = function (jsZipEntry, zipObject) {
"'>manual</a> for information about allowed zip file content");
}
if (type === "MAP") {
var name = jsZipEntry.name.toLowerCase();
var name = filename;
processingPromise = zipObject.file(jsZipEntry.name).async("string").then(function (content) {
self.setFileParserForFilename(name, content);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment