forked from sheetjs/sheetjs
Fix file getter: letter case not match
This commit is contained in:
parent
53f7f6d944
commit
796fbb515a
10
xlsx.js
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user