escape_html_uri
v1.1.5
Published
Escaping Html & URI Entities To Prevent SQLi, XSS, & Related Attacks.
Downloads
26
Maintainers
Readme
<>&/,:;"`\'|{ }$!()*-#[]=~_.+%
// Navigate To https://replit.com/languages/Nodejs#index.js
// On replit Call...
const escapeHTML_URI = require("escape_html_uri");
escapeHTML_URI(
{ b: [true, 26, "Bree", ":", "</>", null, undefined] },
"uri",
":</>"
);
// Replit Output Below...
{
b: [
true,
26,
"Bree",
"%3A",
"%3C%2F%3E",
"A Valid Input Is Required Here...",
"A Valid Input Is Required Here...",
];
}
<script src="escapeHTML_URI.js"></script>
npm i escape_html_uri
gh repo clone Sidodus/escapeHTML_URI
const escapeHTML_URI = require("escape_html_uri");
import { escapeHTML_URI } from "escape_html_uri";
require(["escape_html_uri"], function (html) {
// Use escape_html_uri here in local scope.
});
escapeHTML_URI(html, encodeFormat, htmlEncodeEntity);
escapeHTML_URI("<script>alert(1337)</script>");
Output = <script>alert(1337)</script>
escapeHTML_URI(["<", ">", "&", "/", ",", ":", ";", """, "`", "\", "'", "|", "{", "}", "$", " ", "!", "(", ")", "*", "-", "#", "[", "]", "=", "~"], "html");
Output = ["<", ">", "&;", "/", ",", ":", ";", """, "`", "\", "'", "|", "{", "}", "$", " ", "!", "(", ")", "*", "-", "#;", "[", "]", "=", "~"];
escapeHTML_URI(
{ a: "<", b: ">", c: "\\", "{": "}", x: "<24>", y: "/", z: "{26}" },
"uri"
);
Output = {
a: "%3C",
z: "%3E",
c: "%5C",
x: "%3C24%3E",
y: "%2F",
z: "%7B26%7D",
"{": "%7D",
};
escapeHTML_URI("<script>alert(1337)<\/script>", "uri", "</>");
Output = %3Cscript%3Ealert(1337)%3C%2Fscript%3E;
escapeHTML_URI("aHR0cDovL2V4YW1wbGUuY29t", "unicode", "://");
Output = aHR0cFx1MDAzYVx1MDAyZlx1MDAyZmV4YW1wbGUuY29t;
escapeHTML_URI("http://example.com", "unicode", "://");
Output = http\u003a\u002f\u002fexample.com;
escapeHTML_URI(
{
f: {
str: "<script>alert(1337)<\\/script>",
e: {
arr: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
d: {
func: () => "hello World",
func2: () => () => "Hello JavaScript",
c: {
NulL: null,
undefined,
b: {
Bool: true,
a: {
Bool: false,
obj: {
g: "$",
obj1: { a: ">" },
obj2: { b: "</script>", g: () => "hello World" },
obj3: { b: ["z", 26, "Bree", ":", "</>"] },
str2: "<script>alert(1337)<\\/script>",
NoMansLand: "NoMansLand",
arr: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
},
str3: "<script>alert(1337)<\\/script>",
arr2: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
func3: () => () => () => "hello World",
uri: "http\\u00253A\\u00252F\\u00252Fexample.com",
Base64: "PHNjcmlwdD5hbGVydCgxMzM3KTxcL3NjcmlwdD4=",
base64:
"VlVWb1QyRnRUblJpU0dSclVrUldiMWxyWkZkbFYxSkVXak5vVG1Wck1IcFRNVkl6WkcxTmVWUnViR2hYUlVsM1ZVZGpPVkJSUFQwPQ==",
},
},
},
},
},
},
},
null,
"<>&;/,:;{ }()"
);
Output = {
f: {
str: "<script>alert(1337)</script>",
e: {
arr: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
d: {
func: '() => "hello World"',
func2:
'() => () => "Hello JavaScript"',
c: {
NulL: "A Valid Input Is Required Here...",
undefined: "A Valid Input Is Required Here...",
b: {
Bool: true,
a: {
Bool: false,
obj: {
g: "$",
obj1: {
a: ">",
},
obj2: {
b: "</script>",
g: '() => "hello World"',
},
obj3: {
b: ["z", 26, "Bree", ":", "</>"],
},
str2: "<script>alert(1337)</script>",
NoMansLand: "NoMansLand",
arr: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
},
str3: "<script>alert(1337)</script>",
arr2: [1, ">", "a", "<", 2, "b", "{", 3, "c"],
func3:
'() => () => () => "hello World"',
uri: "http\u00253A\u00252F\u00252Fexample.com",
Base64:
"Jmx0O3NjcmlwdCZndDthbGVydCYjeDI4OzEzMzcmI3gyOTsmbHQ7XCYjeDJmO3NjcmlwdCZndDs=",
base64:
"VTIweE5FMUZPSHBVYlhCcVlsZDRNMXBGVG1GaWJWSkZaRWRvYVZJeFdqVmFSVTVhWVcxV1JWTlVVbEJsYTFZMlZGaHdhbUpWYTNwYU0yeFFWa2hPZEZscmFGSk9NSEJ3VkdwU1RtSldhek5aZWtwUFpWZEdXVkZxUWt0aVYxRjNWRE5qT1ZCUlBUMD0=",
},
},
},
},
},
},
};
Developed By Saheed Odulaja.