From 035a273d3008ee234a8e5913bf38744c13bb53c3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 25 Mar 2023 12:31:39 +0100 Subject: [PATCH] Use `replaceAll` in the `recoverJsURL` helper function We can just do direct replacement when building the regular expression, rather than splitting the string into an Array and then re-joining it. --- src/core/core_utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core_utils.js b/src/core/core_utils.js index fd16b2373..89fad2b6c 100644 --- a/src/core/core_utils.js +++ b/src/core/core_utils.js @@ -515,7 +515,7 @@ function recoverJsURL(str) { const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"]; const regex = new RegExp( "^\\s*(" + - URL_OPEN_METHODS.join("|").split(".").join("\\.") + + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i" );