Fix control characters not being sanitized from shared strings in 1.3.6#345
Open
tcannonfodder wants to merge 3 commits into
Open
Fix control characters not being sanitized from shared strings in 1.3.6#345tcannonfodder wants to merge 3 commits into
tcannonfodder wants to merge 3 commits into
Conversation
…ared strings table output. Conflicts: lib/axlsx/workbook/shared_strings_table.rb
* Commit f8ef8eb fixed the shared strings class to automatically sanitize its serialized XML output to remove any control characters. However, this commit did not include tests that the shared strings actually removed the control characters when serializing to an XML string. * This tests confirms that the string with control characters is added to the shared strings, and that the control characters are removed from the string in question when serialized to XML.
Conflicts: lib/axlsx/version.rb
fd50e87 to
aab304d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?