From 2784978eb5088a5e1c21102680ad0ba90fa99e51 Mon Sep 17 00:00:00 2001 From: a3957273 <89583054+a3957273@users.noreply.github.com> Date: Sat, 30 Mar 2024 14:20:28 +0000 Subject: [PATCH] Fix slash regular expression bug --- src/core/operations/FangURL.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/operations/FangURL.mjs b/src/core/operations/FangURL.mjs index 7390c1a9..93e01770 100644 --- a/src/core/operations/FangURL.mjs +++ b/src/core/operations/FangURL.mjs @@ -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 } @@ -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; }