From 56d7506cf524579293b0bec547714bc0fc859580 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 10 Jan 2011 17:51:55 +0000 Subject: [PATCH] Bugfix: Minor patchfix for Excel2003XML Reader when XML is defined with a charset attribute git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@66707 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/Excel2003XML.php | 14 ++++---------- changelog.txt | 1 + 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2003XML.php b/Classes/PHPExcel/Reader/Excel2003XML.php index de86811..e86e165 100644 --- a/Classes/PHPExcel/Reader/Excel2003XML.php +++ b/Classes/PHPExcel/Reader/Excel2003XML.php @@ -174,7 +174,7 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader // $signature = array( - '', + '' ); @@ -188,16 +188,10 @@ class PHPExcel_Reader_Excel2003XML implements PHPExcel_Reader_IReader $data = fread($fh, 2048); fclose($fh); - $headers = explode("\n",$data); $valid = true; - foreach($signature as $key => $match) { - if (isset($headers[$key])) { - $line = trim(rtrim($headers[$key], "\r\n")); - if ($line != $match) { - $valid = false; - break; - } - } else { + foreach($signature as $match) { + // every part of the signature must be present + if (strpos($data, $match) === false) { $valid = false; break; } diff --git a/changelog.txt b/changelog.txt index 8bbc760..21b68ba 100644 --- a/changelog.txt +++ b/changelog.txt @@ -39,6 +39,7 @@ Fixed in SVN: - Bugfix: (MBaker) Work item 13215 - Formatting get lost and edit a template XLSX file - Bugfix: (MBaker) Work item 14029 - Excel 2007 Reader /writer lost fontcolor - Bugfix: (MBaker) Work item 13374 - file that makes cells go black +- Bugfix: (MBaker) Minor patchfix for Excel2003XML Reader when XML is defined with a charset attribute - General: (MBaker) Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer.