Skip to content

Commit 91cdec8

Browse files
oleibmanGianluca Giovinazzo
authored and
Gianluca Giovinazzo
committed
Reader/Gnumeric Failure with PHP8 (PHPOffice#1662)
* Reader/Gnumeric Failure with PHP8 An explicit cast from SimpleXML to int is now needed with PHP8, where it was performed implicitly with PHP7. Unit tests run correctly for both PHP7 and PHP8 on corrected code.
1 parent ae6c285 commit 91cdec8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PhpSpreadsheet/Reader/Gnumeric.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ public function loadIntoExisting(string $pFilename, Spreadsheet $spreadsheet): S
543543

544544
$endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol'];
545545
$endColumn = Coordinate::stringFromColumnIndex($endColumn + 1);
546-
$endRow = 1 + (($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow']);
546+
547+
$endRow = 1 + (($styleAttributes['endRow'] > $maxRow) ? $maxRow : (int) $styleAttributes['endRow']);
547548
$cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow;
548549

549550
$styleAttributes = $styleRegion->Style->attributes();

0 commit comments

Comments
 (0)