Skip to content

Commit b20f5c1

Browse files
Jerome3PowerKiKi
authored andcommitted
Fix ODS Reader when no DC namespace are defined
ODS files without spreadsheet properties were triggering a fatal error Fixes #1047 Fixes #1176 Closes #1182
1 parent 7e1bf82 commit b20f5c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
2424
- Trying to remove a column that doesn't exist deletes the latest column
2525
- Keep big integer as integer instead of lossely casting to float [#874](https://github.com/PHPOffice/PhpSpreadsheet/pull/874)
2626
- Fix branch pruning handling of non boolean conditions [#1167](https://github.com/PHPOffice/PhpSpreadsheet/pull/1167)
27+
- Fix ODS Reader when no DC namespace are defined [#1182](https://github.com/PHPOffice/PhpSpreadsheet/pull/1182)
2728

2829
## [1.9.0] - 2019-08-17
2930

src/PhpSpreadsheet/Reader/Ods/Properties.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@ public function load(\SimpleXMLElement $xml, $namespacesMeta)
2020
$officeProperty = $xml->children($namespacesMeta['office']);
2121
foreach ($officeProperty as $officePropertyData) {
2222
/** @var \SimpleXMLElement $officePropertyData */
23-
$officePropertiesDC = (object) [];
2423
if (isset($namespacesMeta['dc'])) {
2524
$officePropertiesDC = $officePropertyData->children($namespacesMeta['dc']);
25+
$this->setCoreProperties($docProps, $officePropertiesDC);
2626
}
27-
$this->setCoreProperties($docProps, $officePropertiesDC);
2827

2928
$officePropertyMeta = (object) [];
3029
if (isset($namespacesMeta['dc'])) {

0 commit comments

Comments
 (0)