🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

xss

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xss - npm Package Compare versions

Comparing version

to
0.1.15

2

lib/default.js

@@ -210,3 +210,3 @@ /**

function escapeQuote (str) {
return str.replace(REGEXP_QUOTE, '&quote;');
return str.replace(REGEXP_QUOTE, '"');
}

@@ -213,0 +213,0 @@

{
"name": "xss",
"main": "./lib/index.js",
"version": "0.1.14",
"version": "0.1.15",
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist. 根据白名单过滤HTML(防止XSS攻击)",

@@ -6,0 +6,0 @@ "author": "leizongmin <leizongmin@gmail.com> (http://ucdok.com)",

@@ -47,7 +47,7 @@ /**

assert.equal(xss('<a title=\'abcd\'>'), '<a title="abcd">');
assert.equal(xss('<a title=\'"\'>'), '<a title="&quote;">');
assert.equal(xss('<a title=\'"\'>'), '<a title="&quot;">');
// 没有双引号括起来的属性值
assert.equal(xss('<a title=home>'), '<a title="home">');
assert.equal(xss('<a title=abc("d")>'), '<a title="abc(&quote;d&quote;)">');
assert.equal(xss('<a title=abc("d")>'), '<a title="abc(&quot;d&quot;)">');
assert.equal(xss('<a title=abc(\'d\')>'), '<a title="abc(\'d\')">');

@@ -54,0 +54,0 @@