1717use PhpOffice \PhpSpreadsheet \Reader \Ods \Properties as DocumentProperties ;
1818use PhpOffice \PhpSpreadsheet \Reader \Security \XmlScanner ;
1919use PhpOffice \PhpSpreadsheet \RichText \RichText ;
20- use PhpOffice \PhpSpreadsheet \Settings ;
2120use PhpOffice \PhpSpreadsheet \Shared \Date ;
2221use PhpOffice \PhpSpreadsheet \Shared \File ;
2322use PhpOffice \PhpSpreadsheet \Spreadsheet ;
@@ -58,9 +57,12 @@ public function canRead(string $filename): bool
5857 $ mimeType = $ zip ->getFromName ($ stat ['name ' ]);
5958 } elseif ($ zip ->statName ('META-INF/manifest.xml ' )) {
6059 $ xml = simplexml_load_string (
61- $ this ->getSecurityScannerOrThrow ()->scan ($ zip ->getFromName ('META-INF/manifest.xml ' )),
62- 'SimpleXMLElement ' ,
63- Settings::getLibXmlLoaderOptions ()
60+ $ this ->getSecurityScannerOrThrow ()
61+ ->scan (
62+ $ zip ->getFromName (
63+ 'META-INF/manifest.xml '
64+ )
65+ )
6466 );
6567 if ($ xml !== false ) {
6668 $ namespacesContent = $ xml ->getNamespaces (true );
@@ -98,9 +100,8 @@ public function listWorksheetNames(string $filename): array
98100
99101 $ xml = new XMLReader ();
100102 $ xml ->xml (
101- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
102- null ,
103- Settings::getLibXmlLoaderOptions ()
103+ $ this ->getSecurityScannerOrThrow ()
104+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
104105 );
105106 $ xml ->setParserProperty (2 , true );
106107
@@ -145,9 +146,8 @@ public function listWorksheetInfo(string $filename): array
145146
146147 $ xml = new XMLReader ();
147148 $ xml ->xml (
148- $ this ->getSecurityScannerOrThrow ()->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE ),
149- null ,
150- Settings::getLibXmlLoaderOptions ()
149+ $ this ->getSecurityScannerOrThrow ()
150+ ->scanFile ('zip:// ' . realpath ($ filename ) . '# ' . self ::INITIAL_FILE )
151151 );
152152 $ xml ->setParserProperty (2 , true );
153153
@@ -253,9 +253,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
253253 // Meta
254254
255255 $ xml = @simplexml_load_string (
256- $ this ->getSecurityScannerOrThrow ()->scan ($ zip ->getFromName ('meta.xml ' )),
257- 'SimpleXMLElement ' ,
258- Settings::getLibXmlLoaderOptions ()
256+ $ this ->getSecurityScannerOrThrow ()
257+ ->scan ($ zip ->getFromName ('meta.xml ' ))
259258 );
260259 if ($ xml === false ) {
261260 throw new Exception ('Unable to read data from {$pFilename} ' );
@@ -269,8 +268,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
269268
270269 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
271270 $ dom ->loadXML (
272- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' styles.xml ' )),
273- Settings:: getLibXmlLoaderOptions ( )
271+ $ this ->getSecurityScannerOrThrow ()
272+ -> scan ( $ zip -> getFromName ( ' styles.xml ' ) )
274273 );
275274
276275 $ pageSettings = new PageSettings ($ dom );
@@ -279,8 +278,8 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
279278
280279 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
281280 $ dom ->loadXML (
282- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( self :: INITIAL_FILE )),
283- Settings:: getLibXmlLoaderOptions ( )
281+ $ this ->getSecurityScannerOrThrow ()
282+ -> scan ( $ zip -> getFromName ( self :: INITIAL_FILE ) )
284283 );
285284
286285 $ officeNs = (string ) $ dom ->lookupNamespaceUri ('office ' );
@@ -670,8 +669,8 @@ private function processSettings(ZipArchive $zip, Spreadsheet $spreadsheet): voi
670669 {
671670 $ dom = new DOMDocument ('1.01 ' , 'UTF-8 ' );
672671 $ dom ->loadXML (
673- $ this ->getSecurityScannerOrThrow ()-> scan ( $ zip -> getFromName ( ' settings.xml ' )),
674- Settings:: getLibXmlLoaderOptions ( )
672+ $ this ->getSecurityScannerOrThrow ()
673+ -> scan ( $ zip -> getFromName ( ' settings.xml ' ) )
675674 );
676675 //$xlinkNs = $dom->lookupNamespaceUri('xlink');
677676 $ configNs = (string ) $ dom ->lookupNamespaceUri ('config ' );
0 commit comments