From f93fde9b388de76cdb5bf9f126860efa3a044d2b Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Mon, 20 Sep 2010 15:05:54 +0000 Subject: [PATCH] Bugfix: Workitem 14086 - Named range with sheet name that contains the $ throws exception when getting the cell git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@61245 2327b42d-5241-43d6-9e2a-de5ac946f064 --- Classes/PHPExcel/Reader/Excel2007.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 95fedff9..ab159d0c 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -1345,7 +1345,11 @@ class PHPExcel_Reader_Excel2007 implements PHPExcel_Reader_IReader // Extract range $extractedRange = (string)$definedName; $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange); - $extractedRange = str_replace('$', '', $extractedRange); + if (($spos = strpos($extractedRange,'!')) !== false) { + $extractedRange = substr($extractedRange,0,$spos).str_replace('$', '', substr($extractedRange,$spos)); + } else { + $extractedRange = str_replace('$', '', $extractedRange); + } // Valid range? if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') {