Skip to content

Commit acca05f

Browse files
author
Dominik Bonsch
committed
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
1 parent aadc933 commit acca05f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Classes/PHPExcel/Shared/OLERead.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,22 @@ private function _readPropertySets() {
251251

252252
$name = str_replace("\x00", "", substr($d,0,$nameSize));
253253

254+
254255
$this->props[] = array (
255256
'name' => $name,
256257
'type' => $type,
257258
'startBlock' => $startBlock,
258259
'size' => $size);
259260

261+
// tmp helper to simplify checks
262+
$upName = strtoupper($name);
263+
260264
// Workbook directory entry (BIFF5 uses Book, BIFF8 uses Workbook)
261-
if (($name == 'Workbook') || ($name == 'Book') || ($name == 'WORKBOOK') || ($name == 'BOOK')) {
265+
if (($upName === 'WORKBOOK') || ($upName === 'BOOK')) {
262266
$this->wrkbook = count($this->props) - 1;
263267
}
264-
265-
// Root entry
266-
if ($name == 'Root Entry' || $name == 'ROOT ENTRY' || $name == 'R') {
268+
else if ( $upName === 'ROOT ENTRY' || $upName === 'R') {
269+
// Root entry
267270
$this->rootentry = count($this->props) - 1;
268271
}
269272

0 commit comments

Comments
 (0)