Skip to content
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

Fix control characters not being sanitized from shared strings in 1.3.6 #345

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tcannonfodder
Copy link
Contributor

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?

randym and others added 3 commits August 15, 2014 15:06
…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
@tcannonfodder tcannonfodder force-pushed the fix-control-characters-in-shared-strings-for-1.3.6 branch from fd50e87 to aab304d Compare September 23, 2014 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants