From 710ab744db67626ce6c78cb2d3e6215ba6892460 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Tue, 22 Mar 2016 13:36:24 +0000 Subject: [PATCH] General: (rentalhost) Work Item GH-575 - Excel 2007 Reader freezes because of conditional formatting --- changelog.txt | 1 + src/PhpSpreadsheet/Reader/Excel2007.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index ba5d10bc..15d6b230 100644 --- a/changelog.txt +++ b/changelog.txt @@ -31,6 +31,7 @@ Planned for 1.9 - Feature: (MBaker) - Initial implementation of SUMIFS() function - Feature: (MBaker) - Additional codepages - Feature: (Tomino2112) Work Item GH-808 - MemoryDrawing not working in HTML writer +- General: (rentalhost) Work Item GH-575 - Excel 2007 Reader freezes because of conditional formatting 2015-04-30 (v1.8.1): diff --git a/src/PhpSpreadsheet/Reader/Excel2007.php b/src/PhpSpreadsheet/Reader/Excel2007.php index e1331c26..cf08299d 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007.php +++ b/src/PhpSpreadsheet/Reader/Excel2007.php @@ -1043,8 +1043,9 @@ class Excel2007 extends BaseReader implements IReader } // Extract all cell references in $ref - foreach (\PHPExcel\Cell::extractAllCellReferencesInRange($ref) as $reference) { - $docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles); + $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref))); + foreach ($cellBlocks as $cellBlock) { + $docSheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles); } } }