From e096391f544a1f10becfeec201364adea2f93921 Mon Sep 17 00:00:00 2001 From: Harshvardhan Malpani <2611741+harshvardhanmalpani@users.noreply.github.com> Date: Thu, 30 May 2019 14:04:58 +0530 Subject: [PATCH] NamedRanges with ' in name wont get wiped (#988) Example: 'attr_values'!$D$3:$D$49 earlier this would probably be flushed and getNamedRanges() would not show it because sheet "'attr_values'" does not exist. It should be "attr_values" --- src/PhpSpreadsheet/Reader/Xlsx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Reader/Xlsx.php b/src/PhpSpreadsheet/Reader/Xlsx.php index 30706bac..2607ccbf 100644 --- a/src/PhpSpreadsheet/Reader/Xlsx.php +++ b/src/PhpSpreadsheet/Reader/Xlsx.php @@ -1908,7 +1908,7 @@ class Xlsx extends BaseReader if (strpos((string) $definedName, '!') !== false) { // Extract sheet name $extractedSheetName = Worksheet::extractSheetTitle((string) $definedName, true); - $extractedSheetName = $extractedSheetName[0]; + $extractedSheetName = trim($extractedSheetName[0],"'"); // Locate sheet $locatedSheet = $excel->getSheetByName($extractedSheetName);