Fix reading print area with sheet name containing a comma

This commit is contained in:
CrazyBite 2016-10-03 17:18:38 +09:00 committed by Adrien Crivelli
parent c99ec67d68
commit c94539c86c
No known key found for this signature in database
GPG Key ID: B182FD79DC6DE92E
1 changed files with 1 additions and 2 deletions

View File

@ -1700,7 +1700,7 @@ class Excel2007 extends BaseReader implements IReader
}
break;
case '_xlnm.Print_Area':
$rangeSets = explode(',', $extractedRange); // FIXME: what if sheetname contains comma?
$rangeSets = preg_split("/'(.*?)'(?:![A-Z0-9]+:[A-Z0-9]+,?)/", $extractedRange, PREG_SPLIT_NO_EMPTY);
$newRangeSets = [];
foreach ($rangeSets as $rangeSet) {
$range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark?
@ -1829,7 +1829,6 @@ class Excel2007 extends BaseReader implements IReader
);
$objChart = \PhpOffice\PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
//
if (isset($charts[$chartEntryRef])) {
$chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id'];
if (isset($chartDetails[$chartPositionRef])) {