Skip to content

Commit c6523ab

Browse files
AegirLeetFrederic Delaunay
authored and
Frederic Delaunay
committed
Fix warning when reading xlsx without styles
Fixes PHPOffice/PHPExcel#1134 Fixes PHPOffice#631
1 parent 380925e commit c6523ab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Allow iterators to go out of bounds with prev - [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587)
13+
- Fix warning when reading xlsx without styles - [#631](https://github.com/PHPOffice/PhpSpreadsheet/pull/631)
1314

1415
## [1.4.0] - 2018-08-06
1516

src/PhpSpreadsheet/Reader/Xlsx.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ public function load($pFilename)
643643
$excel->addCellXf($objStyle);
644644
}
645645

646-
foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
646+
foreach (isset($xmlStyles->cellStyleXfs->xf) ? $xmlStyles->cellStyleXfs->xf : [] as $xf) {
647647
$numFmt = NumberFormat::FORMAT_GENERAL;
648648
if ($numFmts && $xf['numFmtId']) {
649649
$tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));

0 commit comments

Comments
 (0)