From c8faca42522b32987d0ad0cc9323d85b03c35bdc Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Tue, 3 Sep 2024 15:19:00 +0200 Subject: [PATCH] fix(ReactPDF): set isEvalSupported to false (#10636) --- components/PDFViewer.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/PDFViewer.tsx b/components/PDFViewer.tsx index e8edfbcab0a..aa8e15dbc64 100644 --- a/components/PDFViewer.tsx +++ b/components/PDFViewer.tsx @@ -1,6 +1,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { throttle } from 'lodash'; +import type { ComponentProps } from 'react'; import { FormattedMessage } from 'react-intl'; import { Document, Page, pdfjs } from 'react-pdf'; import styled from 'styled-components'; @@ -17,9 +18,10 @@ const DocumentContainer = styled.div` } `; -const options = { +const options: ComponentProps['options'] = { cMapUrl: `/static/cmaps/`, cMapPacked: true, + isEvalSupported: false, }; const PDFViewer = ({ pdfUrl, contentWrapperRef, errorTextColor = 'white.full', limitToPageWidth = true, ...props }) => {