PHPWord icon indicating copy to clipboard operation
PHPWord copied to clipboard

Uninitialized string offset in MsDoc.php

Open jaberu opened this issue 8 years ago • 4 comments

When trying to parse a larger doc file I get the following stacktrace:

Uninitialized string offset: 2228225 C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:2305 C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:1147 C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:1099 C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\Reader\MsDoc.php:118 C:\workspace\PhpOfficeUtils\vendor\phpoffice\phpword\src\PhpWord\IOFactory.php:78

I tried to understand what's going on. As it seems the calculated aSed (MsDoc.php:1137) is not correct. The length of the given data string is only 1818112, why reading at index 2228225 causes this error.

Unfortunatelly my document includes sensible data why I cannot share it. If you need any further information please let me know.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jaberu avatar Aug 06 '16 19:08 jaberu

I am having a similar issue, and I am not sure what's wrong. The file is created by Word for Mac.

mabadir avatar Oct 29 '16 12:10 mabadir

I am having the same issue with any *.doc file generated on a mac.

tobiasvielmetter avatar Jan 23 '17 15:01 tobiasvielmetter

The same issue here, any solution?

netoramalho avatar Jul 19 '17 01:07 netoramalho

I am having the same issue with any *.doc file generated image

hirenpatel1903 avatar Sep 05 '22 08:09 hirenpatel1903