mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Prevent errors, because of incorrect scope, in the XMLParserBase._resolveEntities
method (issue 10407)
This commit is contained in:
parent
5a2bd9fc63
commit
6cd9ff48f3
2 changed files with 20 additions and 1 deletions
|
@ -127,4 +127,23 @@ describe('metadata', function() {
|
|||
|
||||
expect(isEmptyObj(metadata.getAll())).toEqual(true);
|
||||
});
|
||||
|
||||
it('should correctly handle metadata containing "&apos" (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\'', });
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue