Fix file getter: letter case not match

This commit is contained in:
Georgy Chikhladze 2016-07-14 18:56:31 +03:00
parent 53f7f6d944
commit 796fbb515a

10
xlsx.js

@ -1314,8 +1314,14 @@ function getdata(data) {
function safegetzipfile(zip, file) {
var f = file; if(zip.files[f]) return zip.files[f];
f = file.toLowerCase(); if(zip.files[f]) return zip.files[f];
f = f.replace(/\//g,'\\'); if(zip.files[f]) return zip.files[f];
var lowerCaseFiles = {};
for (var key in zip.files) {
lowerCaseFiles[key.toLowerCase()] = zip.files[key];
}
f = file.toLowerCase(); if(lowerCaseFiles[f]) return lowerCaseFiles[f];
f = f.replace(/\//g,'\\'); if(lowerCaseFiles[f]) return lowerCaseFiles[f];
return null;
}