You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the following problem in the Nextcloud project, where this code is used in Forms appliaction. It crashes for me because $header and $footer variables are null.
FixPHPOffice#4099. Ods Reader was expecting there to always be `header-style` and `footer-style` tags when `page-layout` tag is present, but these need not exist. It seemed like there might be other exposures along this line in `readPageSettingStyles`; rather than waiting for a problem report to show up for each, the code is updated to use `->item(0)` in place of `[0]` when appropriate, and make use of the nullsafe `?->` operator introduced with Php8.
Hi,
I found the following problem in the Nextcloud project, where this code is used in Forms appliaction. It crashes for me because
$header
and$footer
variables arenull
.I sugest to fix the code with
isset()
test here:PhpSpreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php
Line 69 in fcf03b9
PhpSpreadsheet/src/PhpSpreadsheet/Reader/Ods/PageSettings.php
Line 72 in fcf03b9
The safe code should look like:
$headerProperties = isset($header) ? $header->getElementsByTagNameNS($this->stylesNs, 'header-footer-properties')[0] : null;
The text was updated successfully, but these errors were encountered: