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

Don't break when docProps/core.xml contains a <cp:version> tag #436

Merged
merged 1 commit into from
Nov 21, 2017

Conversation

papandreou
Copy link
Contributor

@papandreou papandreou commented Nov 15, 2017

I've run into an .xlsx that contains a <cp:version> tag in docProps/core.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:title>...</dc:title><dc:creator>...</dc:creator><cp:lastModifiedBy>...</cp:lastModifiedBy><cp:lastPrinted>2017-05-15T16:17:00Z</cp:lastPrinted><dcterms:created xsi:type="dcterms:W3CDTF">2015-07-15T16:27:34Z</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">2017-09-06T15:39:12Z</dcterms:modified><cp:version></cp:version></cp:coreProperties>

This made exceljs break with:

Unexpected xml node in parseOpen: {"name":"cp:version","attributes":{},"isSelfClosing":false}

This PR fixes that by providing a parser for that property.

I would have liked to include a regression test with an actual LibreOffice document, but the most recent version of LibreOffice doesn't seem to include the tag, and I'm unable to share the spreadsheet that actually caused the problem as it includes sensitive data.

@guyonroche
Copy link
Collaborator

I've added that core.xml file as a unit test, that should do...

@guyonroche guyonroche merged commit 3f4f819 into exceljs:master Nov 21, 2017
@papandreou
Copy link
Contributor Author

Ah, good idea. Thanks!

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