Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #405 from ymaerschalck/develop
Browse files Browse the repository at this point in the history
XML External Entity (XXE) Processing
  • Loading branch information
Mark Baker committed Jul 27, 2014
2 parents 3e6cf13 + 0787e56 commit 2a06bc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/PHPExcel/Reader/Excel2003XML.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function listWorksheetNames($pFilename)

$worksheetNames = array();

$xml = simplexml_load_file($pFilename, 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$xml = simplexml_load_string(file_get_contents($pFilename), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$namespaces = $xml->getNamespaces(true);

$xml_ss = $xml->children($namespaces['ss']);
Expand Down Expand Up @@ -165,7 +165,7 @@ public function listWorksheetInfo($pFilename)

$worksheetInfo = array();

$xml = simplexml_load_file($pFilename, 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$xml = simplexml_load_string(file_get_contents($pFilename), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$namespaces = $xml->getNamespaces(true);

$worksheetID = 1;
Expand Down Expand Up @@ -330,7 +330,7 @@ public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
}

$xml = simplexml_load_file($pFilename, 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$xml = simplexml_load_string(file_get_contents($pFilename), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$namespaces = $xml->getNamespaces(true);

$docProps = $objPHPExcel->getProperties();
Expand Down

0 comments on commit 2a06bc9

Please sign in to comment.