Skip to content

Commit

Permalink
Fix slash regular expression bug
Browse files Browse the repository at this point in the history
  • Loading branch information
a3957273 committed Mar 30, 2024
1 parent b4133a0 commit 2784978
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/operations/FangURL.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ class FangURL extends Operation {
this.outputType = "string";
this.args = [
{
name: "Escape [.]",
name: "Restore [.]",
type: "boolean",
value: true
},
{
name: "Escape hxxp",
name: "Restore hxxp",
type: "boolean",
value: true
},
{
name: "Escape ://",
name: "Restore ://",
type: "boolean",
value: true
}
Expand Down Expand Up @@ -69,7 +69,7 @@ class FangURL extends Operation {
function fangURL(url, dots, http, slashes) {
if (dots) url = url.replace(/\[\.\]/g, ".");
if (http) url = url.replace(/hxxp/g, "http");
if (slashes) url = url.replace(/[://]/g, "://");
if (slashes) url = url.replace(/\[:\/\/\]/g, "://");

return url;
}
Expand Down

0 comments on commit 2784978

Please sign in to comment.