-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined offset in Xlsx reader #1293
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
8 tasks
Reopening, (very late) fix is on the way. |
oleibman
added a commit
to oleibman/PhpSpreadsheet
that referenced
this issue
Jun 6, 2024
Fix PHPOffice#4063. Fix PHPOffice#1560. Fix PHPOffice#1293. PhpSpreadsheet is not accounting for an empty string in Xlsx sharedStrings.xml.The code which parses it in Reader/Xlsx looks for a `t` or `r` tag descending from `si`, but, in this case, the tag is coded as `<si/>`, with neither t nor r tag descending. An else clause is added to set the string to empty string in this case. I was surprised that this had not turned up before, and a search through the archives found at least 2 earlier reports from 4 years ago. Those had been marked stale; the stale indicator is removed, and the issues are re-opened, to be closed when this PR is merged.
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is:
Which versions of PhpSpreadsheet and PHP are affected?
File: Undefined offset in Xlsx reader(Cell B1 is an empty richtext).xlsx
PhpSpreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
Lines 439 to 447 in 9fab890
The processing of 441 to 445 lines causes the
$sharedStrings
array to skip the emptySimpleXMLElement
object.Example for
$xmlStrings
:PhpSpreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
Lines 675 to 688 in 9fab890
In this case, a
undefined offset
error would occur on line 679.Fix for empty SimpleXMLElement:
The text was updated successfully, but these errors were encountered: