Skip to content

Commit d4fda28

Browse files
author
Jan-Simon Winkelmann
committed
Prevent notice during accessing "cached magnification factor" offset
1 parent 9683e5b commit d4fda28

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ and this project adheres to [Semantic Versioning](https://semver.org).
4848

4949
### Fixed
5050

51-
- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
51+
- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
52+
- Fix for notice during accessing "cached magnification factor" offset [#1354](https://github.com/PHPOffice/PhpSpreadsheet/pull/1354)
5253

5354
## 1.14.1 - 2020-07-19
5455

src/PhpSpreadsheet/Reader/Xls.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -4377,13 +4377,20 @@ private function readWindow2(): void
43774377
// offset: 10; size: 2; cached magnification factor in page break preview (in percent); 0 = Default (60%)
43784378
// offset: 12; size: 2; cached magnification factor in normal view (in percent); 0 = Default (100%)
43794379
// offset: 14; size: 4; not used
4380-
$zoomscaleInPageBreakPreview = self::getUInt2d($recordData, 10);
4380+
if(!isset($recordData[10])){
4381+
$zoomscaleInPageBreakPreview = 0;
4382+
}else{
4383+
$zoomscaleInPageBreakPreview = self::getUInt2d($recordData, 10);
4384+
}
4385+
43814386
if ($zoomscaleInPageBreakPreview === 0) {
43824387
$zoomscaleInPageBreakPreview = 60;
43834388
}
4384-
$zoomscaleInNormalView = self::getUInt2d($recordData, 12);
4385-
if ($zoomscaleInNormalView === 0) {
4386-
$zoomscaleInNormalView = 100;
4389+
4390+
if(!isset($recordData[12])){
4391+
$zoomscaleInNormalView = 0;
4392+
}else{
4393+
$zoomscaleInNormalView = self::getUInt2d($recordData, 12);
43874394
}
43884395
}
43894396

0 commit comments

Comments
 (0)