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

Merge pull request #10408 from Snuffleupagus/issue-10407

Prevent errors, because of incorrect scope, in the `XMLParserBase._resolveEntities` method (issue 10407)
This commit is contained in:
Tim van der Meij 2019-01-04 23:45:26 +01:00 committed by GitHub
commit b39ec7af96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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) === '#') {