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:
parent
5a2bd9fc63
commit
6cd9ff48f3
2 changed files with 20 additions and 1 deletions
|
@ -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) === '#') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue