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

Fixed Segmentation fault when reading big xlsx files. #1310

Open
wants to merge 2 commits into
base: 1.8
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Classes/PHPExcel/Reader/Excel2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,16 @@ public function load($pFilename)
// reverse
$docSheet->setTitle((string) $eleSheet["name"], false);
$fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
$xmlSheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
$xmlString = $this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet"));
if (!xml_parse($parser = xml_parser_create(), $xmlString)) {
$errorString = xml_error_string(xml_get_error_code($parser));
xml_parser_free($parser);
throw new PHPExcel_Reader_Exception($errorString);
}
xml_parser_free($parser);

$xmlSheet = simplexml_load_string($xmlString, 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");


$sharedFormulas = array();

Expand Down