Prevent stack overflow problem when formula in a cell contains a named range without a worksheet reference... this doesn't fix the formula, but does avoid the exception and allows the workbook to be written with the problematic cell as a blank

git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@86488 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2012-02-14 23:27:50 +00:00
parent c50003e6e1
commit 337af28233
1 changed files with 6 additions and 0 deletions

View File

@ -1055,6 +1055,7 @@ class PHPExcel_Writer_Excel5_Parser
while ($i < $formula_length) { while ($i < $formula_length) {
$token .= $this->_formula{$i}; $token .= $this->_formula{$i};
if ($i < ($formula_length - 1)) { if ($i < ($formula_length - 1)) {
$this->_lookahead = $this->_formula{$i+1}; $this->_lookahead = $this->_formula{$i+1};
} else { } else {
@ -1183,6 +1184,11 @@ class PHPExcel_Writer_Excel5_Parser
{ {
return $token; return $token;
} }
// It's an argument of some description (e.g. a named range),
// precise nature yet to be determined
elseif(substr($token,-1) == ')') {
return $token;
}
return ''; return '';
} }
} }