Skip to content

Commit e76fa86

Browse files
authored
Merge branch 'master' into fix/notice-biff8
2 parents c0f89b9 + ab4d741 commit e76fa86

File tree

12 files changed

+300
-238
lines changed

12 files changed

+300
-238
lines changed

CHANGELOG.md

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

3636
- Improve Coverage for ODS Reader [#1545](https://github.com/phpoffice/phpspreadsheet/pull/1545)
3737
- Named formula implementation, and improved handling of Defined Names generally [#1535](https://github.com/PHPOffice/PhpSpreadsheet/pull/1535)
38-
- fix resolution of relative named range values in the calculation engine; previously all named range values had been treated as absolute.
38+
- fix resolution of relative named range values in the calculation engine; previously all named range values had been treated as absolute.
39+
- Drop $this->spreadSheet null check from Xlsx Writer [#1646](https://github.com/phpoffice/phpspreadsheet/pull/1646)
3940

4041
### Deprecated
4142

@@ -50,6 +51,10 @@ and this project adheres to [Semantic Versioning](https://semver.org).
5051

5152
- PrintArea causes exception [#1544](https://github.com/phpoffice/phpspreadsheet/pull/1544)
5253
- Fix for notice during accessing "cached magnification factor" offset [#1354](https://github.com/PHPOffice/PhpSpreadsheet/pull/1354)
54+
- Calculation/DateTime Failure With PHP8 [#1661](https://github.com/phpoffice/phpspreadsheet/pull/1661)
55+
- Reader/Gnumeric Failure with PHP8 [#1662](https://github.com/phpoffice/phpspreadsheet/pull/1662)
56+
- ReverseSort bug, exposed but not caused by PHP8 [#1660](https://github.com/phpoffice/phpspreadsheet/pull/1660)
57+
- Bug setting Superscript/Subscript to false [#1567](https://github.com/phpoffice/phpspreadsheet/pull/1567)
5358

5459
## 1.14.1 - 2020-07-19
5560

@@ -556,6 +561,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
556561
- Ignore inlineStr type if formula element exists - @ncrypthic [#570](https://github.com/PHPOffice/PHPExcel/issues/570)
557562
- Excel 2007 Reader freezes because of conditional formatting - @rentalhost [#575](https://github.com/PHPOffice/PHPExcel/issues/575)
558563
- Readers will now parse files containing worksheet titles over 31 characters [#176](https://github.com/PHPOffice/PhpSpreadsheet/pull/176)
564+
- Fixed PHP8 deprecation warning for libxml_disable_entity_loader() [#1625](https://github.com/phpoffice/phpspreadsheet/pull/1625)
559565

560566
### General
561567

@@ -577,4 +583,4 @@ For a comprehensive list of all class changes, and a semi-automated migration pa
577583

578584
## Previous versions of PHPExcel
579585

580-
The changelog for the project when it was called PHPExcel is [still available](./CHANGELOG.PHPExcel.md).
586+
The changelog for the project when it was called PHPExcel is [still available](./CHANGELOG.PHPExcel.md).

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
[![License](https://poser.pugx.org/phpoffice/phpspreadsheet/license.png)](https://packagist.org/packages/phpoffice/phpspreadsheet)
99
[![Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PhpSpreadsheet)
1010

11-
PhpSpreadsheet is a library written in pure PHP and providing a set of classes that allow you to read from and to write to different spreadsheet file formats, like Excel and LibreOffice Calc.
11+
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
12+
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
1213

1314
## Documentation
1415

docs/index.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
![Logo](./assets/logo.svg)
44

5-
PhpSpreadsheet is a library written in pure PHP and providing a set of
6-
classes that allow you to read from and to write to different
7-
spreadsheet file formats, like Excel and LibreOffice Calc.
5+
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
6+
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
87

98
## File formats supported
109

src/PhpSpreadsheet/Calculation/DateTime.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ public static function DATEVALUE($dateValue = 1)
489489
if ($yearFound) {
490490
array_unshift($t1, 1);
491491
} else {
492-
if ($t1[1] > 29) {
492+
if (is_numeric($t1[1]) && $t1[1] > 29) {
493493
$t1[1] += 1900;
494494
array_unshift($t1, 1);
495495
} else {

src/PhpSpreadsheet/Reader/Gnumeric.php

+2-1
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();

src/PhpSpreadsheet/Reader/Security/XmlScanner.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function threadSafeLibxmlDisableEntityLoaderAvailability()
6363

6464
private function disableEntityLoaderCheck(): void
6565
{
66-
if (Settings::getLibXmlDisableEntityLoader()) {
66+
if (Settings::getLibXmlDisableEntityLoader() && \PHP_VERSION_ID < 80000) {
6767
$libxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true);
6868

6969
if (self::$libxmlDisableEntityLoaderValue === null) {
@@ -74,7 +74,7 @@ private function disableEntityLoaderCheck(): void
7474

7575
public static function shutdown(): void
7676
{
77-
if (self::$libxmlDisableEntityLoaderValue !== null) {
77+
if (self::$libxmlDisableEntityLoaderValue !== null && \PHP_VERSION_ID < 80000) {
7878
libxml_disable_entity_loader(self::$libxmlDisableEntityLoaderValue);
7979
self::$libxmlDisableEntityLoaderValue = null;
8080
}

src/PhpSpreadsheet/ReferenceHelper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static function columnSort($a, $b)
6969
*/
7070
public static function columnReverseSort($a, $b)
7171
{
72-
return 1 - strcasecmp(strlen($a) . $a, strlen($b) . $b);
72+
return -strcasecmp(strlen($a) . $a, strlen($b) . $b);
7373
}
7474

7575
/**
@@ -108,7 +108,7 @@ public static function cellReverseSort($a, $b)
108108
[$bc, $br] = sscanf($b, '%[A-Z]%d');
109109

110110
if ($ar === $br) {
111-
return 1 - strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);
111+
return -strcasecmp(strlen($ac) . $ac, strlen($bc) . $bc);
112112
}
113113

114114
return ($ar < $br) ? 1 : -1;

src/PhpSpreadsheet/Style/Font.php

+8-14
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,18 @@ public function getSuperscript()
357357
/**
358358
* Set Superscript.
359359
*
360-
* @param bool $pValue
361-
*
362360
* @return $this
363361
*/
364-
public function setSuperscript($pValue)
362+
public function setSuperscript(bool $pValue)
365363
{
366-
if ($pValue == '') {
367-
$pValue = false;
368-
}
369364
if ($this->isSupervisor) {
370365
$styleArray = $this->getStyleArray(['superscript' => $pValue]);
371366
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
372367
} else {
373368
$this->superscript = $pValue;
374-
$this->subscript = !$pValue;
369+
if ($this->superscript) {
370+
$this->subscript = false;
371+
}
375372
}
376373

377374
return $this;
@@ -394,21 +391,18 @@ public function getSubscript()
394391
/**
395392
* Set Subscript.
396393
*
397-
* @param bool $pValue
398-
*
399394
* @return $this
400395
*/
401-
public function setSubscript($pValue)
396+
public function setSubscript(bool $pValue)
402397
{
403-
if ($pValue == '') {
404-
$pValue = false;
405-
}
406398
if ($this->isSupervisor) {
407399
$styleArray = $this->getStyleArray(['subscript' => $pValue]);
408400
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
409401
} else {
410402
$this->subscript = $pValue;
411-
$this->superscript = !$pValue;
403+
if ($this->subscript) {
404+
$this->superscript = false;
405+
}
412406
}
413407

414408
return $this;

0 commit comments

Comments
 (0)