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 );
@@ -97,9 +99,8 @@ public function listWorksheetNames(string $filename): array
9799
98100 $ xml = new XMLReader ();
99101 $ xml ->xml (
100- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
101- null ,
102- Settings::getLibXmlLoaderOptions ()
102+ $ this ->getSecurityScannerOrThrow ()
103+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
103104 );
104105 $ xml ->setParserProperty (2 , true );
105106
@@ -144,9 +145,8 @@ public function listWorksheetInfo(string $filename): array
144145
145146 $ xml = new XMLReader ();
146147 $ xml ->xml (
147- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
148- null ,
149- Settings::getLibXmlLoaderOptions ()
148+ $ this ->getSecurityScannerOrThrow ()
149+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
150150 );
151151 $ xml ->setParserProperty (2 , true );
152152
@@ -252,9 +252,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
252252 // Meta
253253
254254 $ xml = @simplexml_load_string (
255- $ this ->getSecurityScannerOrThrow ()->scan ($ zip ->getFromName ('meta.xml ' )),
256- 'SimpleXMLElement ' ,
257- Settings::getLibXmlLoaderOptions ()
255+ $ this ->getSecurityScannerOrThrow ()
256+ ->scan ($ zip ->getFromName ('meta.xml ' ))
258257 );
259258 if ($ xml === false ) {
260259 throw new Exception ('Unable to read data from {$pFilename} ' );
@@ -268,8 +267,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
268267
269268 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
270269 $ dom ->loadXML (
271- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' styles.xml ' )),
272- Settings:: getLibXmlLoaderOptions ( )
270+ $ this ->getSecurityScannerOrThrow ()
271+ -> scan ( $ zip -> getFromName ( ' styles.xml ' ) )
273272 );
274273
275274 $ pageSettings = new PageSettings ($ dom );
@@ -278,8 +277,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
278277
279278 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
280279 $ dom ->loadXML (
281- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( self :: INITIAL_FILE )),
282- Settings:: getLibXmlLoaderOptions ( )
280+ $ this ->getSecurityScannerOrThrow ()
281+ -> scan ( $ zip -> getFromName ( self :: INITIAL_FILE ) )
283282 );
284283
285284 $ officeNs = (string ) $ dom ->lookupNamespaceUri ('office ' );
@@ -655,8 +654,8 @@ private function processSettings(ZipArchive $zip, Spreadsheet $spreadsheet): voi
655654 {
656655 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
657656 $ dom ->loadXML (
658- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' settings.xml ' )),
659- Settings:: getLibXmlLoaderOptions ( )
657+ $ this ->getSecurityScannerOrThrow ()
658+ -> scan ( $ zip -> getFromName ( ' settings.xml ' ) )
660659 );
661660 //$xlinkNs = $dom->lookupNamespaceUri('xlink');
662661 $ configNs = (string ) $ dom ->lookupNamespaceUri ('config ' );
0 commit comments