FIX PHP Fatal Error on an invalid Blip Field.

For (still) unknown reasons, PHPExcel detects a wrong field type.
If there is no BSE Index, we will fail here and other fields are not read.
So if the BSE Index < 1, continue with the next field.
TODO: Why is there no BSE Index?
      Is this a new Office Version?
      Password protected field?
      More likely : a uncompatible picture

PHP Notice:  Undefined offset: -1 in Classes/PHPExcel/Reader/Excel5.php on line 1063
PHP Fatal error:  Call to a member function getBlipType() on a non-object in Classes/PHPExcel/Reader/Excel5.php on line 1064
This commit is contained in:
Herman M. Hofman 2016-01-19 12:15:10 +01:00 committed by Adrien Crivelli
parent c1f5bdba5d
commit b964788d5c
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 9 additions and 0 deletions

View File

@ -1031,6 +1031,15 @@ class Xls extends BaseReader implements IReader
// picture
// get index to BSE entry (1-based)
$BSEindex = $spContainer->getOPT(0x0104);
// If there is no BSE Index, we will fail here and other fields are not read.
// Fix by checking here.
// TODO: Why is there no BSE Index? Is this a new Office Version? Password protected field?
// More likely : a uncompatible picture
if (!$BSEindex) {
continue;
}
$BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();
$BSE = $BSECollection[$BSEindex - 1];
$blipType = $BSE->getBlipType();