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.
This commit is contained in:
parent
c706c6c34f
commit
035a273d30
@ -515,7 +515,7 @@ function recoverJsURL(str) {
|
|||||||
const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
|
const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
|
||||||
const regex = new RegExp(
|
const regex = new RegExp(
|
||||||
"^\\s*(" +
|
"^\\s*(" +
|
||||||
URL_OPEN_METHODS.join("|").split(".").join("\\.") +
|
URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") +
|
||||||
")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))",
|
")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))",
|
||||||
"i"
|
"i"
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user