1616use PhpOffice \PhpSpreadsheet \Reader \Ods \Properties as DocumentProperties ;
1717use PhpOffice \PhpSpreadsheet \Reader \Security \XmlScanner ;
1818use PhpOffice \PhpSpreadsheet \RichText \RichText ;
19- use PhpOffice \PhpSpreadsheet \Settings ;
2019use PhpOffice \PhpSpreadsheet \Shared \Date ;
2120use PhpOffice \PhpSpreadsheet \Shared \File ;
2221use PhpOffice \PhpSpreadsheet \Spreadsheet ;
@@ -57,9 +56,12 @@ public function canRead(string $filename): bool
5756 $ mimeType = $ zip ->getFromName ($ stat ['name ' ]);
5857 } elseif ($ zip ->statName ('META-INF/manifest.xml ' )) {
5958 $ xml = simplexml_load_string (
60- $ this ->getSecurityScannerOrThrow ()->scan ($ zip ->getFromName ('META-INF/manifest.xml ' )),
61- 'SimpleXMLElement ' ,
62- Settings::getLibXmlLoaderOptions ()
59+ $ this ->getSecurityScannerOrThrow ()
60+ ->scan (
61+ $ zip ->getFromName (
62+ 'META-INF/manifest.xml '
63+ )
64+ )
6365 );
6466 if ($ xml !== false ) {
6567 $ namespacesContent = $ xml ->getNamespaces (true );
@@ -100,9 +102,8 @@ public function listWorksheetNames($filename)
100102
101103 $ xml = new XMLReader ();
102104 $ xml ->xml (
103- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
104- null ,
105- Settings::getLibXmlLoaderOptions ()
105+ $ this ->getSecurityScannerOrThrow ()
106+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
106107 );
107108 $ xml ->setParserProperty (2 , true );
108109
@@ -151,9 +152,8 @@ public function listWorksheetInfo($filename)
151152
152153 $ xml = new XMLReader ();
153154 $ xml ->xml (
154- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
155- null ,
156- Settings::getLibXmlLoaderOptions ()
155+ $ this ->getSecurityScannerOrThrow ()
156+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
157157 );
158158 $ xml ->setParserProperty (2 , true );
159159
@@ -262,9 +262,8 @@ public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
262262 // Meta
263263
264264 $ xml = @simplexml_load_string (
265- $ this ->getSecurityScannerOrThrow ()->scan ($ zip ->getFromName ('meta.xml ' )),
266- 'SimpleXMLElement ' ,
267- Settings::getLibXmlLoaderOptions ()
265+ $ this ->getSecurityScannerOrThrow ()
266+ ->scan ($ zip ->getFromName ('meta.xml ' ))
268267 );
269268 if ($ xml === false ) {
270269 throw new Exception ('Unable to read data from {$pFilename} ' );
@@ -278,8 +277,8 @@ public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
278277
279278 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
280279 $ dom ->loadXML (
281- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' styles.xml ' )),
282- Settings:: getLibXmlLoaderOptions ( )
280+ $ this ->getSecurityScannerOrThrow ()
281+ -> scan ( $ zip -> getFromName ( ' styles.xml ' ) )
283282 );
284283
285284 $ pageSettings = new PageSettings ($ dom );
@@ -288,8 +287,8 @@ public function loadIntoExisting($filename, Spreadsheet $spreadsheet)
288287
289288 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
290289 $ dom ->loadXML (
291- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( self :: INITIAL_FILE )),
292- Settings:: getLibXmlLoaderOptions ( )
290+ $ this ->getSecurityScannerOrThrow ()
291+ -> scan ( $ zip -> getFromName ( self :: INITIAL_FILE ) )
293292 );
294293
295294 $ officeNs = $ dom ->lookupNamespaceUri ('office ' );
@@ -664,8 +663,8 @@ private function processSettings(ZipArchive $zip, Spreadsheet $spreadsheet): voi
664663 {
665664 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
666665 $ dom ->loadXML (
667- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' settings.xml ' )),
668- Settings:: getLibXmlLoaderOptions ( )
666+ $ this ->getSecurityScannerOrThrow ()
667+ -> scan ( $ zip -> getFromName ( ' settings.xml ' ) )
669668 );
670669 //$xlinkNs = $dom->lookupNamespaceUri('xlink');
671670 $ configNs = $ dom ->lookupNamespaceUri ('config ' );
0 commit comments