@@ -252,6 +252,7 @@ public function listWorksheetInfo($filename)
252
252
$ xmlWorkbook = $ this ->loadZip ($ relTarget , $ mainNS );
253
253
if ($ xmlWorkbook ->sheets ) {
254
254
$ dir = dirname ($ relTarget );
255
+
255
256
/** @var SimpleXMLElement $eleSheet */
256
257
foreach ($ xmlWorkbook ->sheets ->sheet as $ eleSheet ) {
257
258
$ tmpInfo = [
@@ -267,8 +268,8 @@ public function listWorksheetInfo($filename)
267
268
268
269
$ xml = new XMLReader ();
269
270
$ xml ->xml (
270
- $ this ->getSecurityScannerOrThrow ()->scanFile (
271
- ' zip:// ' . File:: realpath ( $ filename ) . ' # ' . $ fileWorksheetPath
271
+ $ this ->getSecurityScannerOrThrow ()->scan (
272
+ $ this -> getFromZipArchive ( $ this -> zip , $ fileWorksheetPath)
272
273
),
273
274
null ,
274
275
Settings::getLibXmlLoaderOptions ()
@@ -403,12 +404,18 @@ private function getFromZipArchive(ZipArchive $archive, $fileName = '')
403
404
// Sadly, some 3rd party xlsx generators don't use consistent case for filenaming
404
405
// so we need to load case-insensitively from the zip file
405
406
406
- // Apache POI fixes
407
407
$ contents = $ archive ->getFromName ($ fileName , 0 , ZipArchive::FL_NOCASE );
408
+
409
+ // Apache POI fixes
408
410
if ($ contents === false ) {
409
411
$ contents = $ archive ->getFromName (substr ($ fileName , 1 ), 0 , ZipArchive::FL_NOCASE );
410
412
}
411
413
414
+ // Has the file been saved with Windoze directory separators rather than unix?
415
+ if ($ contents === false ) {
416
+ $ contents = $ archive ->getFromName (str_replace ('/ ' , '\\' , $ fileName ), 0 , ZipArchive::FL_NOCASE );
417
+ }
418
+
412
419
return ($ contents === false ) ? '' : $ contents ;
413
420
}
414
421
0 commit comments