Check for is_object

Without this , it give php-warning-invalid-argument-supplied-for-foreach error.
This commit is contained in:
Mohd Farhan Firdaus Jamil 2014-11-16 23:00:45 +08:00
parent 184c1bc290
commit 793fc2a08f
1 changed files with 2 additions and 0 deletions

View File

@ -1935,6 +1935,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
if (isset($is->t)) { if (isset($is->t)) {
$value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) ); $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) );
} else { } else {
if(is_object($is->r)) {
foreach ($is->r as $run) { foreach ($is->r as $run) {
if (!isset($run->rPr)) { if (!isset($run->rPr)) {
$objText = $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $run->t ) ); $objText = $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $run->t ) );
@ -1987,6 +1988,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
} }
} }
} }
}
return $value; return $value;
} }