Skip to content

Commit 5fb1fb4

Browse files
committed
Invalid Builtin Defined Name in Xls Reader
Fix #3935. Xls Reader cannot parse user's spreadsheet, failing on a token of 3d. I believe that, according to https://msopenspecs.azureedge.net/files/MS-XLS/%5bMS-XLS%5d.pdf, this represents a PtgAreaErr3d, i.e. an invalid reference. User cannot provide spreadsheet, but was quite forthcoming in providing additional debugging information. I am usually reluctant to make changes without a test case, however, in this case, the action being taken (treat "builtin" defined name as "not builtin" when it cannot be parsed) makes sense, and it satisfies the user's processing.
1 parent d620497 commit 5fb1fb4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/PhpSpreadsheet/Reader/Xls.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,6 +2740,7 @@ private function readDefinedName(): void
27402740
$formula = $this->getFormulaFromStructure($formulaStructure);
27412741
} catch (PhpSpreadsheetException) {
27422742
$formula = '';
2743+
$isBuiltInName = 0;
27432744
}
27442745

27452746
$this->definedname[] = [

0 commit comments

Comments
 (0)