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

Commit

Permalink
Bugfix: Work Item GH-384 - DOM loadHTMLFile() failing with options fl…
Browse files Browse the repository at this point in the history
…ags when using PHP < 5.4.0
  • Loading branch information
MarkBaker committed Aug 23, 2014
1 parent d777d02 commit a7cf8c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Classes/PHPExcel/CachedObjectStorage/DiscISAM.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public function getCacheData($pCoord) {

// Set current entry to the requested entry
$this->_currentObjectID = $pCoord;
fseek($this->_fileHandle,$this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle,$this->_cellCache[$pCoord]['sz']));
fseek($this->_fileHandle, $this->_cellCache[$pCoord]['ptr']);
$this->_currentObject = unserialize(fread($this->_fileHandle, $this->_cellCache[$pCoord]['sz']));
// Re-attach this as the cell's parent
$this->_currentObject->attach($this);

Expand Down
11 changes: 6 additions & 5 deletions Classes/PHPExcel/Reader/HTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,13 @@ public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
// Create a new DOM object
$dom = new DOMDocument;
// Reload the HTML file into the DOM object
$loaded = $dom->loadHTMLFile($pFilename, PHPExcel_Settings::getLibXmlLoaderOptions());
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
$loaded = $dom->loadHTMLFile($pFilename, PHPExcel_Settings::getLibXmlLoaderOptions());
} else {
$loaded = $dom->loadHTMLFile($pFilename);
}
if ($loaded === FALSE) {
throw new PHPExcel_Reader_Exception('Failed to load ',$pFilename,' as a DOM Document');
throw new PHPExcel_Reader_Exception('Failed to load '. $pFilename. ' as a DOM Document');
}

// Discard white space
Expand All @@ -438,9 +442,6 @@ public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
$content = '';
$this->_processDomElement($dom,$objPHPExcel->getActiveSheet(),$row,$column,$content);

// echo '<hr />';
// var_dump($this->_dataArray);

// Return
return $objPHPExcel;
}
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Planned for v1.8.1
- Bugfix: (MBaker) Work Item GH-350 - Keep/set the value on Reader _loadSheetsOnly as NULL, courtesy of Restless-ET
- Bugfix: (MBaker) Work Item CP18105 - Loading an Excel 2007 spreadsheet throws an "Autofilter must be set on a range of cells" exception
- Bugfix: (MBaker) - Fix to autoloader registration for backward compatibility with PHP 5.2.0 not accepting the prepend flag
- Bugfix: (MBaker) Work Item GH-384 - DOM loadHTMLFile() failing with options flags when using PHP < 5.4.0
- General: (MBaker) - Small performance improvement for autosize columns
- General: (frost-nzcr4) Work Item GH-379 - Change the getter/setter for zeroHeight to camel case
- Feature: (WiktrzGE) Work Item GH-404 - Methods to manage most of the existing options for Chart Axis, Major Grid-lines and Minor Grid-lines
Expand Down

0 comments on commit a7cf8c6

Please sign in to comment.