From a0ac293ec6cbd452fb573e938daca51e87824bf4 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Thu, 17 Mar 2011 11:29:14 +0000 Subject: [PATCH] Bugfix: Work item 15537 - Excel2007 Reader canRead function bug git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@70501 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/Excel2007.php | 16 +++++++++------- changelog.txt | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 7cbe0ea1..111e0b6d 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -200,14 +200,16 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader if ($zip->open($pFilename) === true) { // check if it is an OOXML archive $rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels")); - foreach ($rels->Relationship as $rel) { - switch ($rel["Type"]) { - case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": - if (basename($rel["Target"]) == 'workbook.xml') { - $xl = true; - } - break; + if ($rels) { + foreach ($rels->Relationship as $rel) { + switch ($rel["Type"]) { + case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument": + if (basename($rel["Target"]) == 'workbook.xml') { + $xl = true; + } + break; + } } } $zip->close(); diff --git a/changelog.txt b/changelog.txt index d5b5e694..98ea4093 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,6 +26,7 @@ Fixed in SVN: - Bugfix: (MBaker) Work item 15459 - Invalid cell coordinate in Autofilter for Excel2007 Writer - Bugfix: (MBaker) Work item 15518 - PCLZip library issue +- Bugfix: (MBaker) Work item 15537 - Excel2007 Reader canRead function bug - General: (MBaker) Work item 15405 - Two easy to fix Issues concerning PHPExcel_Token_Stack (l10n/UC) - General: (MBaker) Work item 15461 - Locale file paths not fit for windows