From acca05f1cfcc51bfdd91d00ede50d07d002e75ed Mon Sep 17 00:00:00 2001 From: Dominik Bonsch Date: Tue, 22 Jan 2013 20:39:45 +0100 Subject: [PATCH] minor architecture improvement - used strtoupper to get rid of case sensitive name checks - added "else if", it's not nessecary to check for the second "if", if the first one was allready true --- Classes/PHPExcel/Shared/OLERead.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Classes/PHPExcel/Shared/OLERead.php b/Classes/PHPExcel/Shared/OLERead.php index f67eeac3..6f2696ed 100644 --- a/Classes/PHPExcel/Shared/OLERead.php +++ b/Classes/PHPExcel/Shared/OLERead.php @@ -251,19 +251,22 @@ class PHPExcel_Shared_OLERead { $name = str_replace("\x00", "", substr($d,0,$nameSize)); + $this->props[] = array ( 'name' => $name, 'type' => $type, 'startBlock' => $startBlock, 'size' => $size); + // tmp helper to simplify checks + $upName = strtoupper($name); + // Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook) - if (($name == 'Workbook') || ($name == 'Book') || ($name == 'WORKBOOK') || ($name == 'BOOK')) { + if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) { $this->wrkbook = count($this->props) - 1; } - - // Root entry - if ($name == 'Root Entry' || $name == 'ROOT ENTRY' || $name == 'R') { + else if ( $upName === 'ROOT ENTRY' || $upName === 'R') { + // Root entry $this->rootentry = count($this->props) - 1; }