Merge pull request #15170 from calixteman/js_rm_null
[JS] Embedded JS scripts can have some null chars
This commit is contained in:
commit
de7d1d2167
@ -982,7 +982,8 @@ class Catalog {
|
||||
if (javaScript === null) {
|
||||
javaScript = new Map();
|
||||
}
|
||||
javaScript.set(name, stringToPDFString(js));
|
||||
js = stringToPDFString(js).replace(/\u0000/g, "");
|
||||
javaScript.set(name, js);
|
||||
}
|
||||
|
||||
if (obj instanceof Dict && obj.has("JavaScript")) {
|
||||
|
@ -339,7 +339,7 @@ function _collectJS(entry, xref, list, parents) {
|
||||
} else if (typeof js === "string") {
|
||||
code = js;
|
||||
}
|
||||
code = code && stringToPDFString(code);
|
||||
code = code && stringToPDFString(code).replace(/\u0000/g, "");
|
||||
if (code) {
|
||||
list.push(code);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user