feat: add support for allowList as an alias for whiteList

This commit is contained in:
Matthew Benjamin Schupack
2021-12-13 13:11:43 -05:00
parent 3826e74155
commit 6914bbaf93
5 changed files with 21 additions and 5 deletions

4
dist/xss.js vendored
View File

@@ -857,7 +857,7 @@ function shallowCopyObject(obj) {
* FilterXSS class
*
* @param {Object} options
* whiteList, onTag, onTagAttr, onIgnoreTag,
* whiteList (or allowList), onTag, onTagAttr, onIgnoreTag,
* onIgnoreTagAttr, safeAttrValue, escapeHtml
* stripIgnoreTagBody, allowCommentTag, stripBlankChar
* css{whiteList, onAttr, onIgnoreAttr} `css=false` means don't use `cssfilter`
@@ -874,7 +874,7 @@ function FilterXSS(options) {
options.onIgnoreTag = DEFAULT.onIgnoreTagStripAll;
}
options.whiteList = options.whiteList || DEFAULT.whiteList;
options.whiteList = options.whiteList || options.allowList || DEFAULT.whiteList;
options.onTag = options.onTag || DEFAULT.onTag;
options.onTagAttr = options.onTagAttr || DEFAULT.onTagAttr;
options.onIgnoreTag = options.onIgnoreTag || DEFAULT.onIgnoreTag;

2
dist/xss.min.js vendored

File diff suppressed because one or more lines are too long