1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 08:38:06 +02:00

Prevent errors, because of incorrect scope, in the XMLParserBase._resolveEntities method (issue 10407)

This commit is contained in:
Jonas Jenwald 2019-01-03 21:41:52 +01:00
parent 5a2bd9fc63
commit 6cd9ff48f3
2 changed files with 20 additions and 1 deletions

View file

@ -46,7 +46,7 @@ function isWhitespaceString(s) {
class XMLParserBase {
_resolveEntities(s) {
return s.replace(/&([^;]+);/g, function (all, entity) {
return s.replace(/&([^;]+);/g, (all, entity) => {
if (entity.substring(0, 2) === '#x') {
return String.fromCharCode(parseInt(entity.substring(2), 16));
} else if (entity.substring(0, 1) === '#') {