v0.2.7
This commit is contained in:
6
dist/xss.js
vendored
6
dist/xss.js
vendored
@@ -539,7 +539,8 @@ function parseTag (html, onTag, escapeHtml) {
|
|||||||
tagStart = false;
|
tagStart = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (c === '"' || c === "'") {
|
// HTML标签内的引号仅当前一个字符是等于号时才有效
|
||||||
|
if ((c === '"' || c === "'") && html.charAt(currentPos - 1) === '=') {
|
||||||
quoteStart = c;
|
quoteStart = c;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -595,7 +596,8 @@ function parseAttr (html, onAttr) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tmpName !== false) {
|
if (tmpName !== false) {
|
||||||
if (i === lastPos && (c === '"' || c === "'")) {
|
// HTML标签内的引号仅当前一个字符是等于号时才有效
|
||||||
|
if (i === lastPos && (c === '"' || c === "'") && html.charAt(i - 1) === '=') {
|
||||||
j = html.indexOf(c, i + 1);
|
j = html.indexOf(c, i + 1);
|
||||||
if (j === -1) {
|
if (j === -1) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
2
dist/xss.min.js
vendored
2
dist/xss.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "xss",
|
"name": "xss",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"version": "0.2.6",
|
"version": "0.2.7",
|
||||||
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist. 根据白名单过滤HTML(防止XSS攻击)",
|
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist. 根据白名单过滤HTML(防止XSS攻击)",
|
||||||
"author": "leizongmin <leizongmin@gmail.com> (http://ucdok.com)",
|
"author": "leizongmin <leizongmin@gmail.com> (http://ucdok.com)",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
|
|||||||
Reference in New Issue
Block a user