-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Escape any dollar signs when formatting cell data #4243
Escape any dollar signs when formatting cell data #4243
Conversation
61c0f25
to
32a004f
Compare
a726ff9
to
3af8f4e
Compare
4d7bc6b
to
171ca3a
Compare
This commit fix two issues that happened when the a cell was formatted as text * When the cell contains a number prefixed with dollar sign, this number is getting replaced with 0. The replacement happens due to the preg_replace function. * When the cell contains quotes, the quote would be removed.
171ca3a
to
3eee749
Compare
I finally figured it out - we want special processing for quote marks if they are part of the format, but not if they are part of the value. Updated your code slightly, added a new test case. I think this is what we need, or pretty close if not. I'll continue to think about for a day or two, and then merge. |
@sirbaconjr We seem to be working at cross purposes. If you have changes you still want to make, please use the current state of the PR as your starting point - commit 4b568b4 |
Thank you for your contribution, and for your patience as we expanded the scope of your change. |
This is:
Checklist:
Why this change is needed?
Fix #4242. When a cell is formatted as text and contains a number prefixed with dollar sign, this number is getting replaced with 0. The replacement happens due to the preg_replace function. This commit escapes any sollar signs on the cell data, so those are not replaced.