Merge pull request #16208 from Snuffleupagus/recoverJsURL-replaceAll

Use `replaceAll` in the `recoverJsURL` helper function
This commit is contained in:
Tim van der Meij 2023-03-25 15:20:33 +01:00 committed by GitHub
commit b3e2e26079
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"
);