From e95a2670347f87dc96cca9d88a9c2e904a73bb17 Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Sun, 2 Oct 2016 20:21:13 +0900 Subject: [PATCH] Apostrophes in sheet names prevented save If a sheet name included an apostrophe and the sheet had print area defined then the spreadsheet could not be saved because the cell coordinates were mangled, eg: 'Fiche d''action'!$A$1:$N$19 wrongly became: 'Fiche d'$A$1:$N$19 --- src/PhpSpreadsheet/Reader/Excel2007.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/PhpSpreadsheet/Reader/Excel2007.php b/src/PhpSpreadsheet/Reader/Excel2007.php index a44c8b7f..1e86e2c6 100644 --- a/src/PhpSpreadsheet/Reader/Excel2007.php +++ b/src/PhpSpreadsheet/Reader/Excel2007.php @@ -1655,7 +1655,6 @@ class Excel2007 extends BaseReader implements IReader foreach ($xmlWorkbook->definedNames->definedName as $definedName) { // Extract range $extractedRange = (string) $definedName; - $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); if (($spos = strpos($extractedRange, '!')) !== false) { $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); } else { @@ -1730,7 +1729,6 @@ class Excel2007 extends BaseReader implements IReader foreach ($xmlWorkbook->definedNames->definedName as $definedName) { // Extract range $extractedRange = (string) $definedName; - $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); if (($spos = strpos($extractedRange, '!')) !== false) { $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos)); } else {