From 7180f375eabe2c8675dea5014ad0a4f44525ac4b Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 1 Feb 2021 16:17:45 +0100
Subject: [PATCH] Fix tests: Older Firefox doesn't support the "s" flag for
 RegExp

---
 src/utils.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils.js b/src/utils.js
index 67f4f4e..0eadfe8 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -111,8 +111,8 @@ export const readBinaryFileContent = async (file) => {
  */
 export const getPDFSignatureCount = async (file) => {
     const sigRegex = new RegExp(
-        "/Type\\s*/Sig.*?/SubFilter\\s*(/ETSI\\.CAdES\\.detached|/adbe\\.pkcs7\\.detached)",
-        "gs");
+        "/Type\\s*/Sig(.|\\s)*?/SubFilter\\s*(/ETSI\\.CAdES\\.detached|/adbe\\.pkcs7\\.detached)",
+        "g");
     const content = await readBinaryFileContent(file);
     let matches = 0;
     while (sigRegex.exec(content) !== null) {
-- 
GitLab