mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Fix slash regular expression bug
This commit is contained in:
parent
b4133a0afd
commit
2784978eb5
1 changed files with 4 additions and 4 deletions
|
@ -24,17 +24,17 @@ class FangURL extends Operation {
|
||||||
this.outputType = "string";
|
this.outputType = "string";
|
||||||
this.args = [
|
this.args = [
|
||||||
{
|
{
|
||||||
name: "Escape [.]",
|
name: "Restore [.]",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
value: true
|
value: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Escape hxxp",
|
name: "Restore hxxp",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
value: true
|
value: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Escape ://",
|
name: "Restore ://",
|
||||||
type: "boolean",
|
type: "boolean",
|
||||||
value: true
|
value: true
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ class FangURL extends Operation {
|
||||||
function fangURL(url, dots, http, slashes) {
|
function fangURL(url, dots, http, slashes) {
|
||||||
if (dots) url = url.replace(/\[\.\]/g, ".");
|
if (dots) url = url.replace(/\[\.\]/g, ".");
|
||||||
if (http) url = url.replace(/hxxp/g, "http");
|
if (http) url = url.replace(/hxxp/g, "http");
|
||||||
if (slashes) url = url.replace(/[://]/g, "://");
|
if (slashes) url = url.replace(/\[:\/\/\]/g, "://");
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue