Skip to content

CALCULATION_REGEXP_CELLREF is not sufficiently robust. #1263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

CALCULATION_REGEXP_CELLREF is not sufficiently robust. #1263

wants to merge 3 commits into from

Conversation

oleibman
Copy link
Collaborator

It treats some perfectly legal defined names, e.g. A1A, as cell refs.
When the Xlsx Writer tries to save a worksheet which uses such a name
in a formula in a cell, it throws an exception.
The new DefinedNameConfusedForCellTest is a simple demonstration.
The Regexp has been changed to ensure the name starts on a Word boundary,
and to make sure it is not followed by a word character or period.
This fixes the problem, and does not appear to cause any regression
problems in the test suite.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

Bug fix, as described above. I am not sure how to go about adding a summary of the change to
CHANGELOG.md - that seems to be something that the project maintainer would do.
No documentation change is required.

It treats some perfectly legal defined names, e.g. A1A, as cell refs.
When the Xlsx Writer tries to save a worksheet which uses such a name
in a formula in a cell, it throws an exception.
The new DefinedNameConfusedForCellTest is a simple demonstration.
The Regexp has been changed to ensure the name starts on a Word boundary,
   and to make sure it is not followed by a word character or period.
This fixes the problem, and does not appear to cause any regression
   problems in the test suite.
Try/catch wasn't needed. Phpunit catches the unexpected exception.
@PowerKiKi PowerKiKi closed this in 9552172 Nov 30, 2019
PowerKiKi added a commit that referenced this pull request Nov 30, 2019
@oleibman oleibman deleted the calcchange branch January 7, 2020 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant