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:
parent
c1f5bdba5d
commit
b964788d5c
|
@ -1031,6 +1031,15 @@ class Xls extends BaseReader implements IReader
|
||||||
// picture
|
// picture
|
||||||
// get index to BSE entry (1-based)
|
// get index to BSE entry (1-based)
|
||||||
$BSEindex = $spContainer->getOPT(0x0104);
|
$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();
|
$BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();
|
||||||
$BSE = $BSECollection[$BSEindex - 1];
|
$BSE = $BSECollection[$BSEindex - 1];
|
||||||
$blipType = $BSE->getBlipType();
|
$blipType = $BSE->getBlipType();
|
||||||
|
|
Loading…
Reference in New Issue