Skip to content

Importing some bad XLS file it could generate bunch of warnings "Uninitialized string offset" #4647

@MekDrop

Description

@MekDrop

It seems that in some cases count($recordData) < $pos, and the issue originates from this file: https://github.com/PHPOffice/PhpSpreadsheet/blob/5.1.0/src/PhpSpreadsheet/Reader/Xls.php#L2025

I'm not sure if I still have a bad file, since it happened overnight during the daily imports.
If I find one, I'll attach it later.

I can see two possible solutions here:

  1. Silently fail
  2. Throw an exception if the index is not found (I think this is probably the better option, since such files usually have a bad structure anyways).

I'm not sure which approach is preferred, but I could create a PR if needed (note: this would be my first PR).

Update: Found the file (compressed because github didn't let me upload) -> ddship.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions