Skip to content
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

XLSX crashes with autor issue because of illigal offset (array) #2227

Closed
Leycarno opened this issue Jul 19, 2021 · 2 comments
Closed

XLSX crashes with autor issue because of illigal offset (array) #2227

Leycarno opened this issue Jul 19, 2021 · 2 comments

Comments

@Leycarno
Copy link

This is:


- [ X] a bug report


### What is the expected behavior?

   read the excel proper and handle authorlist issues...

### What is the current behavior?

 "exception": [
        {
            "type": "TypeError",
            "code": 0,
            "message": "Illegal offset type",
            "file": "C:\\REPOS\\Eis20\\eis-pro-backend\\vendor\\phpoffice\\phpspreadsheet\\src\\PhpSpreadsheet\\Reader\\Xlsx.php",
            "line": 884
        }
    ]

### Solution /quickfix

**FILE : PhpOffice\PhpSpreadsheet\Reader\Xlsx.php
LINES 880 - 887**

  // Loop through contents
  foreach ($commentsFile->commentList->comment as $comment) {
      $commentModel = $docSheet->getComment((string) $comment['ref']);
      if (!empty($comment['authorId'] 
      **// !!! prove  for the existent key in the authors array
          && in_array($comment['authorId'], $authors))) {**
          $commentModel->setAuthor($authors[$comment['authorId']]);
      }
      $commentModel->setText($this->parseRichText($comment->text));
  }
@MarkBaker
Copy link
Member

Duplicate of Issue #2184

@oleibman
Copy link
Collaborator

oleibman commented Sep 3, 2022

Closing. Fixed by PR #2329 which was merged in October 2021.

@oleibman oleibman closed this as completed Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants