perfect-express-sanitizer
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -308,7 +308,2 @@ module.exports = [ | ||
{ | ||
regex: '1*56', | ||
flag: 'ig', | ||
level: 5 | ||
}, | ||
{ | ||
regex: 'ORDER BY', | ||
@@ -629,7 +624,2 @@ flag: 'ig', | ||
{ | ||
regex: 'admin', | ||
flag: 'ig', | ||
level: 5 | ||
}, | ||
{ | ||
regex: '"*"', | ||
@@ -636,0 +626,0 @@ flag: 'ig', |
@@ -5,3 +5,7 @@ const nosql_injection = require('./nosql_injection'); | ||
const prepareSanitize = (data, options = { xss: true, sql: false, noSql: false, sqlLevel: 5, noSqlLevel: 5 }) => { | ||
const prepareSanitize = (data, options = { xss: true, sql: false, noSql: false, sqlLevel: 5, noSqlLevel: 5, level }) => { | ||
if (options.level){ | ||
options.sqlLevel = options.level; | ||
options.noSqlLevel = options.level; | ||
} | ||
if (options.xss) | ||
@@ -8,0 +12,0 @@ data = xss_sanitize.prepareSanitize(data, options) |
{ | ||
"name": "perfect-express-sanitizer", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "a complete package to control user input data to prevent Cross Site Scripting (XSS) ,Sql injection and no Sql injection attack", | ||
@@ -64,2 +64,2 @@ "main": "index.js", | ||
] | ||
} | ||
} |
@@ -327,4 +327,11 @@ | ||
}); | ||
it("test static digit", function () { | ||
const perfectExpressSanitizer = require("../index"); | ||
const cleanResult = perfectExpressSanitizer.sanitize.prepareSanitize("55-56-89-85", { xss: true, noSql: true, sql: true, level: 5 }); | ||
const dirtyResult = perfectExpressSanitizer.sanitize.prepareSanitize("55-56-89-85;'Drop'", { xss: true, noSql: true, sql: true, level: 5 }); | ||
expect(cleanResult).to.equal('55-56-89-85'); | ||
expect(dirtyResult).to.equal('55-56-89-85'); | ||
}); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
206394
1567