diff --git a/CHANGELOG.md b/CHANGELOG.md index faf7ae4b..180814a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Control characters in cell values are automatically escaped - [#212](https://github.com/PHPOffice/PhpSpreadsheet/issues/212) - Prevent color changing when copy/pasting xls files written by PhpSpreadsheet to another file - @al-lala [#218](https://github.com/PHPOffice/PhpSpreadsheet/issues/218) - Add cell reference automatic when there is no cell reference('r' attribute) in Xlsx file. - @GreatHumorist [#225](https://github.com/PHPOffice/PhpSpreadsheet/pull/225) Refer to [issue#201](https://github.com/PHPOffice/PhpSpreadsheet/issues/201) +- `Reader\Xlsx::getFromZipArchive()` function return false if the zip entry could not be located. - @anton-harvey [#268](https://github.com/PHPOffice/PhpSpreadsheet/pull/268) ### BREAKING CHANGE diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 1e8828fb..5d6c574a 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -308,13 +308,9 @@ class Xlsx extends BaseReader // so we need to load case-insensitively from the zip file // Apache POI fixes - $contents = $archive->getFromIndex( - $archive->locateName($fileName, ZipArchive::FL_NOCASE) - ); + $contents = $archive->getFromName($fileName, 0, ZipArchive::FL_NOCASE); if ($contents === false) { - $contents = $archive->getFromIndex( - $archive->locateName(substr($fileName, 1), ZipArchive::FL_NOCASE) - ); + $contents = $archive->getFromName(substr($fileName, 1), 0, ZipArchive::FL_NOCASE); } return $contents;