Fix control characters not being sanitized from shared strings in 1.3.6 #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In version 1.3.6, the shared strings are not sanitized to remove any control characters that may be present in the string. This causes excel files generated using shared strings to require repairs and lose data on opening.
This was fixed for later versions in f8ef8eb, so I cherry-picked the commit, fixing a conflict in
Axlsx::SharedStringsTable.to_xml_string
. I also wrote a test to confirm the control characters are actually removed.Note that this PR is for version 1.3.6 of the gem. I'm not sure how you want to want to apply this patch, possibly as a point release?