mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Merge pull request #14658 from Snuffleupagus/api-validate-cMapUrl-standardFontDataUrl
Validate the `cMapUrl`/`standardFontDataUrl` parameters in `getDocument`
This commit is contained in:
commit
790735eaf1
1 changed files with 6 additions and 0 deletions
|
@ -338,6 +338,12 @@ function getDocument(src) {
|
||||||
if (!Number.isInteger(params.maxImageSize)) {
|
if (!Number.isInteger(params.maxImageSize)) {
|
||||||
params.maxImageSize = -1;
|
params.maxImageSize = -1;
|
||||||
}
|
}
|
||||||
|
if (typeof params.cMapUrl !== "string") {
|
||||||
|
params.cMapUrl = null;
|
||||||
|
}
|
||||||
|
if (typeof params.standardFontDataUrl !== "string") {
|
||||||
|
params.standardFontDataUrl = null;
|
||||||
|
}
|
||||||
if (typeof params.useWorkerFetch !== "boolean") {
|
if (typeof params.useWorkerFetch !== "boolean") {
|
||||||
params.useWorkerFetch =
|
params.useWorkerFetch =
|
||||||
params.CMapReaderFactory === DOMCMapReaderFactory &&
|
params.CMapReaderFactory === DOMCMapReaderFactory &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue