From 793fc2a08fcedc4e283f0f141687ab9095a2ee2f Mon Sep 17 00:00:00 2001 From: Mohd Farhan Firdaus Jamil Date: Sun, 16 Nov 2014 23:00:45 +0800 Subject: [PATCH] Check for is_object Without this , it give php-warning-invalid-argument-supplied-for-foreach error. --- Classes/PHPExcel/Reader/Excel2007.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 3b0c1a7..277d278 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -1935,6 +1935,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE if (isset($is->t)) { $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $is->t ) ); } else { + if(is_object($is->r)) { foreach ($is->r as $run) { if (!isset($run->rPr)) { $objText = $value->createText( PHPExcel_Shared_String::ControlCharacterOOXML2PHP( (string) $run->t ) ); @@ -1986,6 +1987,7 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE } } } + } } return $value;