overleaf/server-ce/hotfix/4.2.5/pr_18444.patch
Jakob Ackermann aa142b3c09 Merge pull request #18825 from overleaf/jpa-hotfix-4-2-5-5-0-5
[server-pro] add hotfixes 4.2.5 and 5.0.5

GitOrigin-RevId: 55a138662d3c2059ce802e6a6fd70e70fd01c8cd
2024-06-12 08:05:32 +00:00

41 lines
2 KiB
Diff

diff --git a/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx b/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx
index 4d3b80bb9a2..3efc61a2199 100644
--- a/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx
+++ b/services/web/frontend/js/features/file-view/components/file-view-pdf.tsx
@@ -33,7 +33,10 @@ const FileViewPdf: FC<{
return
}
- const pdf = await PDFJS.getDocument(preview.url).promise
+ const pdf = await PDFJS.getDocument({
+ url: preview.url,
+ isEvalSupported: false,
+ }).promise
// bail out if loading the PDF took too long
if (!mountedRef.current) {
diff --git a/services/web/frontend/js/features/pdf-preview/util/pdf-js-wrapper.js b/services/web/frontend/js/features/pdf-preview/util/pdf-js-wrapper.js
index 9b419b1397f..6a92630a215 100644
--- a/services/web/frontend/js/features/pdf-preview/util/pdf-js-wrapper.js
+++ b/services/web/frontend/js/features/pdf-preview/util/pdf-js-wrapper.js
@@ -96,6 +96,7 @@ export default class PDFJSWrapper {
rangeChunkSize,
disableAutoFetch: true,
disableStream,
+ isEvalSupported: false,
textLayerMode: 2, // PDFJSViewer.TextLayerMode.ENABLE,
range: rangeTransport,
})
diff --git a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts
index 7321f9e02b5..f6c744aaec2 100644
--- a/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts
+++ b/services/web/frontend/js/features/source-editor/extensions/visual/visual-widgets/graphics.ts
@@ -143,7 +143,7 @@ export class GraphicsWidget extends WidgetType {
return
}
- const pdf = await PDFJS.getDocument(url).promise
+ const pdf = await PDFJS.getDocument({ url, isEvalSupported: false }).promise
const page = await pdf.getPage(1)
// bail out if loading the PDF took too long