-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Prevent errors, because of incorrect scope, in the XMLParserBase._resolveEntities
method (issue 10407)
#10408
Conversation
I looked into this and managed to create a unit test: + it('should resolve entities correctly (issue 10407)', function() {
+ const data = '<x:xmpmeta xmlns:x=\'adobe:ns:meta/\'>' +
+ '<rdf:RDF xmlns:rdf=\'http://www.w3.org/1999/02/22-rdf-syntax-ns#\'>' +
+ '<rdf:Description xmlns:dc=\'http://purl.org/dc/elements/1.1/\'>' +
+ '<dc:title><rdf:Alt><rdf:li xml:lang="x-default">'Foo bar baz'</rdf:li>' +
+ '</rdf:Alt></dc:title></rdf:Description></rdf:RDF></x:xmpmeta>';
+ const metadata = new Metadata(data);
+
+ expect(metadata.has('dc:title')).toBeTruthy();
+ expect(metadata.has('dc:qux')).toBeFalsy();
+
+ expect(metadata.get('dc:title')).toEqual('\'Foo bar baz\'');
+ expect(metadata.get('dc:qux')).toEqual(null);
+
+ expect(metadata.getAll()).toEqual({ 'dc:title': '\'Foo bar baz\'', });
+ }); It's equal to the first unit test in the file with the title now containing |
Sorry about not providing a test pdf on the original issue. However, I would like to provide one now. I was able to reproduce a test case PDF file with all of the sensitive data striped out by using the following steps:
|
Thank you for providing this, @dhollenbeck! It will definitely help us to verify the fix with the actual bad metadata. |
9462505
to
1d8abf3
Compare
…solveEntities` method (issue 10407)
1d8abf3
to
6cd9ff4
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/aa696ea48a2f450/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/7b2b43618af4d28/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/aa696ea48a2f450/output.txt Total script time: 17.59 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/7b2b43618af4d28/output.txt Total script time: 23.37 mins
|
Nice work! |
Now with a unit-test, courtesy of #10408 (comment).
Fixes #10407.