From da2484d19b61b5eb35a8dad3460f0b193ac8cb2c Mon Sep 17 00:00:00 2001 From: Mario Heiderich Date: Tue, 25 Apr 2017 09:45:59 +0200 Subject: [PATCH] Preparing 0.8.7 release --- bower.json | 2 +- dist/purify.min.js | 2 +- dist/purify.min.js.map | 2 +- package.json | 2 +- src/purify.js | 2 +- website/index.html | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bower.json b/bower.json index 8b3d81a00..5eaf74451 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "DOMPurify", - "version": "0.8.6", + "version": "0.8.7", "homepage": "https://github.com/cure53/DOMPurify", "author": "Cure53 ", "description": "A DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG", diff --git a/dist/purify.min.js b/dist/purify.min.js index 9c8d79cd7..54a474b56 100644 --- a/dist/purify.min.js +++ b/dist/purify.min.js @@ -1,2 +1,2 @@ -(function(e){"use strict";var t=typeof window==="undefined"?null:window;if(typeof define==="function"&&define.amd){define(function(){return e(t)})}else if(typeof module!=="undefined"){module.exports=e(t)}else{t.DOMPurify=e(t)}})(function e(t){"use strict";var r=function(t){return e(t)};r.version="0.8.6";r.removed=[];if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var a=n;var i=t.DocumentFragment;var o=t.HTMLTemplateElement;var l=t.Node;var s=t.NodeFilter;var f=t.NamedNodeMap||t.MozNamedAttrMap;var c=t.Text;var u=t.Comment;var d=t.DOMParser;var m=t.safari&&typeof t.safari.pushNotification==="object"||false;if(typeof o==="function"){var p=n.createElement("template");if(p.content&&p.content.ownerDocument){n=p.content.ownerDocument}}var v=n.implementation;var h=n.createNodeIterator;var g=n.getElementsByTagName;var y=n.createDocumentFragment;var T=a.importNode;var b={};r.isSupported=typeof v.createHTMLDocument!=="undefined"&&n.documentMode!==9;var A=function(e,t){var r=t.length;while(r--){if(typeof t[r]==="string"){t[r]=t[r].toLowerCase()}e[t[r]]=true}return e};var x=function(e){var t={};var r;for(r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t};var k=null;var w=A({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]);var E=null;var N=A({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var O=null;var S=null;var D=true;var M=true;var L=false;var _=false;var C=false;var R=/\{\{[\s\S]*|[\s\S]*\}\}/gm;var z=/<%[\s\S]*|[\s\S]*%>/gm;var F=false;var H=false;var I=false;var j=false;var B=false;var W=true;var G=true;var P=A({},["audio","head","math","script","style","svg","video"]);var U=A({},["audio","video","img","source","image"]);var q=A({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]);var V=null;var Y=n.createElement("form");var K=function(e){if(typeof e!=="object"){e={}}k="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS):w;E="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR):N;O="FORBID_TAGS"in e?A({},e.FORBID_TAGS):{};S="FORBID_ATTR"in e?A({},e.FORBID_ATTR):{};D=e.ALLOW_ARIA_ATTR!==false;M=e.ALLOW_DATA_ATTR!==false;L=e.ALLOW_UNKNOWN_PROTOCOLS||false;_=e.SAFE_FOR_JQUERY||false;C=e.SAFE_FOR_TEMPLATES||false;F=e.WHOLE_DOCUMENT||false;I=e.RETURN_DOM||false;j=e.RETURN_DOM_FRAGMENT||false;B=e.RETURN_DOM_IMPORT||false;H=e.FORCE_BODY||false;W=e.SANITIZE_DOM!==false;G=e.KEEP_CONTENT!==false;if(C){M=false}if(j){I=true}if(e.ADD_TAGS){if(k===w){k=x(k)}A(k,e.ADD_TAGS)}if(e.ADD_ATTR){if(E===N){E=x(E)}A(E,e.ADD_ATTR)}if(e.ADD_URI_SAFE_ATTR){A(q,e.ADD_URI_SAFE_ATTR)}if(G){k["#text"]=true}if(Object&&"freeze"in Object){Object.freeze(e)}V=e};var $=function(e){r.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}};var J=function(e,t){r.removed.push({attribute:t.getAttributeNode(e),from:t});t.removeAttribute(e)};var Q=function(e){var t,r;if(H){e=""+e}if(!m){try{t=(new d).parseFromString(e,"text/html")}catch(n){}}if(!t||!t.documentElement){t=v.createHTMLDocument("");r=t.body;r.parentNode.removeChild(r.parentNode.firstElementChild);r.outerHTML=e}if(typeof t.getElementsByTagName==="function"){return t.getElementsByTagName(F?"html":"body")[0]}return g.call(t,F?"html":"body")[0]};var X=function(e){return h.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,function(){return s.FILTER_ACCEPT},false)};var Z=function(e){if(e instanceof c||e instanceof u){return false}if(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof f)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"){return true}return false};var ee=function(e){return typeof l==="object"?e instanceof l:e&&typeof e==="object"&&typeof e.nodeType==="number"&&typeof e.nodeName==="string"};var te=function(e){var t,n;fe("beforeSanitizeElements",e,null);if(Z(e)){$(e);return true}t=e.nodeName.toLowerCase();fe("uponSanitizeElement",e,{tagName:t,allowedTags:k});if(!k[t]||O[t]){if(G&&!P[t]&&typeof e.insertAdjacentHTML==="function"){try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(a){}}$(e);return true}if(_&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)&&/u){e.setAttribute("id",s.value)}}else if(e.nodeName==="INPUT"&&l==="type"&&o==="file"&&(E[l]||!S[l])){continue}else{if(i==="id"){e.setAttribute(i,"")}J(i,e)}if(!c.keepAttr){continue}if(W&&(l==="id"||l==="name")&&(o in t||o in n||o in Y)){continue}if(C){o=o.replace(R," ");o=o.replace(z," ")}if(M&&re.test(l)){}else if(D&&ne.test(l)){}else if(!E[l]||S[l]){continue}else if(q[l]){}else if(ae.test(o.replace(oe,""))){}else if((l==="src"||l==="xlink:href")&&o.indexOf("data:")===0&&U[e.nodeName.toLowerCase()]){}else if(L&&!ie.test(o.replace(oe,""))){}else if(!o){}else{continue}try{e.setAttribute(i,o);r.removed.pop()}catch(d){}}fe("afterSanitizeAttributes",e,null)};var se=function(e){var t;var r=X(e);fe("beforeSanitizeShadowDOM",e,null);while(t=r.nextNode()){fe("uponSanitizeShadowNode",t,null);if(te(t)){continue}if(t.content instanceof i){se(t.content)}le(t)}fe("afterSanitizeShadowDOM",e,null)};var fe=function(e,t,n){if(!b[e]){return}b[e].forEach(function(e){e.call(r,t,n,V)})};r.sanitize=function(e,n){var o,s,f,c,u,d;if(!e){e=""}if(typeof e!=="string"&&!ee(e)){if(typeof e.toString!=="function"){throw new TypeError("toString is not a function")}else{e=e.toString()}}if(!r.isSupported){if(typeof t.toStaticHTML==="object"||typeof t.toStaticHTML==="function"){if(typeof e==="string"){return t.toStaticHTML(e)}else if(ee(e)){return t.toStaticHTML(e.outerHTML)}}return e}K(n);r.removed=[];if(e instanceof l){o=Q("");s=o.ownerDocument.importNode(e,true);if(s.nodeType===1&&s.nodeName==="BODY"){o=s}else{o.appendChild(s)}}else{if(!I&&!F&&e.indexOf("<")===-1){return e}o=Q(e);if(!o){return I?null:""}}if(H){$(o.firstChild)}u=X(o);while(f=u.nextNode()){if(f.nodeType===3&&f===c){continue}if(te(f)){continue}if(f.content instanceof i){se(f.content)}le(f);c=f}if(I){if(j){d=y.call(o.ownerDocument);while(o.firstChild){d.appendChild(o.firstChild)}}else{d=o}if(B){d=T.call(a,d,true)}return d}return F?o.outerHTML:o.innerHTML};r.addHook=function(e,t){if(typeof t!=="function"){return}b[e]=b[e]||[];b[e].push(t)};r.removeHook=function(e){if(b[e]){b[e].pop()}};r.removeHooks=function(e){if(b[e]){b[e]=[]}};r.removeAllHooks=function(){b={}};return r}); +(function(e){"use strict";var t=typeof window==="undefined"?null:window;if(typeof define==="function"&&define.amd){define(function(){return e(t)})}else if(typeof module!=="undefined"){module.exports=e(t)}else{t.DOMPurify=e(t)}})(function e(t){"use strict";var r=function(t){return e(t)};r.version="0.8.7";r.removed=[];if(!t||!t.document||t.document.nodeType!==9){r.isSupported=false;return r}var n=t.document;var a=n;var i=t.DocumentFragment;var o=t.HTMLTemplateElement;var l=t.Node;var s=t.NodeFilter;var f=t.NamedNodeMap||t.MozNamedAttrMap;var c=t.Text;var u=t.Comment;var d=t.DOMParser;var m=false;if(typeof o==="function"){var p=n.createElement("template");if(p.content&&p.content.ownerDocument){n=p.content.ownerDocument}}var v=n.implementation;var h=n.createNodeIterator;var g=n.getElementsByTagName;var y=n.createDocumentFragment;var T=a.importNode;var b={};r.isSupported=typeof v.createHTMLDocument!=="undefined"&&n.documentMode!==9;var A=function(e,t){var r=t.length;while(r--){if(typeof t[r]==="string"){t[r]=t[r].toLowerCase()}e[t[r]]=true}return e};var x=function(e){var t={};var r;for(r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t};var k=null;var w=A({},["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr","svg","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","switch","symbol","text","textpath","title","tref","tspan","view","vkern","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmuliscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mpspace","msqrt","mystyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","#text"]);var E=null;var S=A({},["accept","action","align","alt","autocomplete","background","bgcolor","border","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","coords","datetime","default","dir","disabled","download","enctype","face","for","headers","height","hidden","high","href","hreflang","id","ismap","label","lang","list","loop","low","max","maxlength","media","method","min","multiple","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","span","srclang","start","src","step","style","summary","tabindex","title","type","usemap","valign","value","width","xmlns","accent-height","accumulate","additivive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mode","min","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","surfacescale","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","u1","u2","unicode","values","viewbox","visibility","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","y","y1","y2","z","zoomandpan","accent","accentunder","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","display","displaystyle","fence","frame","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]);var N=null;var O=null;var D=true;var M=true;var L=false;var _=false;var C=false;var R=/\{\{[\s\S]*|[\s\S]*\}\}/gm;var z=/<%[\s\S]*|[\s\S]*%>/gm;var F=false;var H=false;var I=false;var j=false;var B=false;var W=true;var G=true;var P=A({},["audio","head","math","script","style","template","svg","video"]);var U=A({},["audio","video","img","source","image"]);var q=A({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]);var V=null;var Y=n.createElement("form");var K=function(e){if(typeof e!=="object"){e={}}k="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS):w;E="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR):S;N="FORBID_TAGS"in e?A({},e.FORBID_TAGS):{};O="FORBID_ATTR"in e?A({},e.FORBID_ATTR):{};D=e.ALLOW_ARIA_ATTR!==false;M=e.ALLOW_DATA_ATTR!==false;L=e.ALLOW_UNKNOWN_PROTOCOLS||false;_=e.SAFE_FOR_JQUERY||false;C=e.SAFE_FOR_TEMPLATES||false;F=e.WHOLE_DOCUMENT||false;I=e.RETURN_DOM||false;j=e.RETURN_DOM_FRAGMENT||false;B=e.RETURN_DOM_IMPORT||false;H=e.FORCE_BODY||false;W=e.SANITIZE_DOM!==false;G=e.KEEP_CONTENT!==false;if(C){M=false}if(j){I=true}if(e.ADD_TAGS){if(k===w){k=x(k)}A(k,e.ADD_TAGS)}if(e.ADD_ATTR){if(E===S){E=x(E)}A(E,e.ADD_ATTR)}if(e.ADD_URI_SAFE_ATTR){A(q,e.ADD_URI_SAFE_ATTR)}if(G){k["#text"]=true}if(Object&&"freeze"in Object){Object.freeze(e)}V=e};var $=function(e){r.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}};var J=function(e,t){r.removed.push({attribute:t.getAttributeNode(e),from:t});t.removeAttribute(e)};var Q=function(e){var t,r;if(H){e=""+e}if(m){try{t=(new d).parseFromString(e,"text/html")}catch(n){}}if(!t||!t.documentElement){t=v.createHTMLDocument("");r=t.body;r.parentNode.removeChild(r.parentNode.firstElementChild);r.outerHTML=e}return g.call(t,F?"html":"body")[0]};if(r.isSupported){(function(){var e=Q('

');if(e.getElementsByTagName("img")[0].hasAttribute("onerror")){m=true}})()}var X=function(e){return h.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,function(){return s.FILTER_ACCEPT},false)};var Z=function(e){if(e instanceof c||e instanceof u){return false}if(typeof e.nodeName!=="string"||typeof e.textContent!=="string"||typeof e.removeChild!=="function"||!(e.attributes instanceof f)||typeof e.removeAttribute!=="function"||typeof e.setAttribute!=="function"){return true}return false};var ee=function(e){return typeof l==="object"?e instanceof l:e&&typeof e==="object"&&typeof e.nodeType==="number"&&typeof e.nodeName==="string"};var te=function(e){var t,n;fe("beforeSanitizeElements",e,null);if(Z(e)){$(e);return true}t=e.nodeName.toLowerCase();fe("uponSanitizeElement",e,{tagName:t,allowedTags:k});if(!k[t]||N[t]){if(G&&!P[t]&&typeof e.insertAdjacentHTML==="function"){try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(a){}}$(e);return true}if(_&&!e.firstElementChild&&(!e.content||!e.content.firstElementChild)&&/u){e.setAttribute("id",s.value)}}else if(e.nodeName==="INPUT"&&l==="type"&&o==="file"&&(E[l]||!O[l])){continue}else{if(i==="id"){e.setAttribute(i,"")}J(i,e)}if(!c.keepAttr){continue}if(W&&(l==="id"||l==="name")&&(o in t||o in n||o in Y)){continue}if(C){o=o.replace(R," ");o=o.replace(z," ")}if(M&&re.test(l)){}else if(D&&ne.test(l)){}else if(!E[l]||O[l]){continue}else if(q[l]){}else if(ae.test(o.replace(oe,""))){}else if((l==="src"||l==="xlink:href")&&o.indexOf("data:")===0&&U[e.nodeName.toLowerCase()]){}else if(L&&!ie.test(o.replace(oe,""))){}else if(!o){}else{continue}try{e.setAttribute(i,o);r.removed.pop()}catch(d){}}fe("afterSanitizeAttributes",e,null)};var se=function(e){var t;var r=X(e);fe("beforeSanitizeShadowDOM",e,null);while(t=r.nextNode()){fe("uponSanitizeShadowNode",t,null);if(te(t)){continue}if(t.content instanceof i){se(t.content)}le(t)}fe("afterSanitizeShadowDOM",e,null)};var fe=function(e,t,n){if(!b[e]){return}b[e].forEach(function(e){e.call(r,t,n,V)})};r.sanitize=function(e,n){var o,s,f,c,u,d;if(!e){e=""}if(typeof e!=="string"&&!ee(e)){if(typeof e.toString!=="function"){throw new TypeError("toString is not a function")}else{e=e.toString()}}if(!r.isSupported){if(typeof t.toStaticHTML==="object"||typeof t.toStaticHTML==="function"){if(typeof e==="string"){return t.toStaticHTML(e)}else if(ee(e)){return t.toStaticHTML(e.outerHTML)}}return e}K(n);r.removed=[];if(e instanceof l){o=Q("");s=o.ownerDocument.importNode(e,true);if(s.nodeType===1&&s.nodeName==="BODY"){o=s}else{o.appendChild(s)}}else{if(!I&&!F&&e.indexOf("<")===-1){return e}o=Q(e);if(!o){return I?null:""}}if(H){$(o.firstChild)}u=X(o);while(f=u.nextNode()){if(f.nodeType===3&&f===c){continue}if(te(f)){continue}if(f.content instanceof i){se(f.content)}le(f);c=f}if(I){if(j){d=y.call(o.ownerDocument);while(o.firstChild){d.appendChild(o.firstChild)}}else{d=o}if(B){d=T.call(a,d,true)}return d}return F?o.outerHTML:o.innerHTML};r.addHook=function(e,t){if(typeof t!=="function"){return}b[e]=b[e]||[];b[e].push(t)};r.removeHook=function(e){if(b[e]){b[e].pop()}};r.removeHooks=function(e){if(b[e]){b[e]=[]}};r.removeAllHooks=function(){b={}};return r}); //# sourceMappingURL=./dist/purify.min.js.map \ No newline at end of file diff --git a/dist/purify.min.js.map b/dist/purify.min.js.map index 5387d1283..3a96ecd9c 100644 --- a/dist/purify.min.js.map +++ b/dist/purify.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["./src/purify.js"],"names":["factory","root","window","define","amd","module","exports","DOMPurify","version","removed","document","nodeType","isSupported","originalDocument","DocumentFragment","HTMLTemplateElement","Node","NodeFilter","NamedNodeMap","MozNamedAttrMap","Text","Comment","DOMParser","safari","pushNotification","template","createElement","content","ownerDocument","implementation","createNodeIterator","getElementsByTagName","createDocumentFragment","importNode","hooks","createHTMLDocument","documentMode","_addToSet","set","array","l","length","toLowerCase","_cloneObj","object","newObject","property","hasOwnProperty","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","SAFE_FOR_JQUERY","SAFE_FOR_TEMPLATES","MUSTACHE_EXPR","ERB_EXPR","WHOLE_DOCUMENT","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_DOM_IMPORT","SANITIZE_DOM","KEEP_CONTENT","FORBID_CONTENTS","DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","CONFIG","formElement","_parseConfig","cfg","ADD_TAGS","ADD_ATTR","ADD_URI_SAFE_ATTR","Object","freeze","_forceRemove","node","push","element","parentNode","removeChild","e","outerHTML","_removeAttribute","name","attribute","getAttributeNode","from","removeAttribute","_initDocument","dirty","doc","body","parseFromString","documentElement","firstElementChild","call","_createIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","FILTER_ACCEPT","_isClobbered","elm","nodeName","textContent","attributes","setAttribute","_isNode","obj","_sanitizeElements","currentNode","tagName","_executeHook","allowedTags","insertAdjacentHTML","innerHTML","test","cloneNode","replace","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","_sanitizeAttributes","attr","value","lcName","idAttr","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","trim","id","Array","prototype","slice","apply","indexOf","pop","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","entryPoint","data","forEach","hook","sanitize","importedNode","oldNode","nodeIterator","returnNode","toString","TypeError","toStaticHTML","appendChild","firstChild","addHook","hookFunction","removeHook","removeHooks","removeAllHooks"],"mappings":"CAAE,SAASA,GACP,YAEA,IAAIC,SAAcC,UAAW,YAAc,KAAOA,MAElD,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAC5CD,OAAO,WAAY,MAAOH,GAAQC,SAC/B,UAAWI,UAAW,YAAa,CACtCA,OAAOC,QAAUN,EAAQC,OACtB,CACHA,EAAKM,UAAYP,EAAQC,MAE/B,QAASD,GAAQE,GACf,YAEA,IAAIK,GAAY,SAASL,GACrB,MAAOF,GAAQE,GAOnBK,GAAUC,QAAU,OAMpBD,GAAUE,UAEV,KAAKP,IAAWA,EAAOQ,UAAYR,EAAOQ,SAASC,WAAa,EAAG,CAG/DJ,EAAUK,YAAc,KACxB,OAAOL,GAGX,GAAIG,GAAWR,EAAOQ,QACtB,IAAIG,GAAmBH,CACvB,IAAII,GAAmBZ,EAAOY,gBAC9B,IAAIC,GAAsBb,EAAOa,mBACjC,IAAIC,GAAOd,EAAOc,IAClB,IAAIC,GAAaf,EAAOe,UACxB,IAAIC,GAAehB,EAAOgB,cAAgBhB,EAAOiB,eACjD,IAAIC,GAAOlB,EAAOkB,IAClB,IAAIC,GAAUnB,EAAOmB,OACrB,IAAIC,GAAYpB,EAAOoB,SACvB,IAAIC,GAAUrB,EAAOqB,cACVrB,GAAOqB,OAAOC,mBAAqB,UAAa,KA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AEnB,CAEH,IAAK/F,IAAeF,GAAkBkC,EAAMmD,QAAQ,QAAU,EAAG,CAC7D,MAAOnD,GAIXE,EAAOH,EAAcC,EAGrB,KAAKE,EAAM,CACP,MAAOlC,GAAa,KAAO,IAKnC,GAAID,EAAY,CACZkB,EAAaiB,EAAKqE,YAItBN,EAAe1D,EAAgBL,EAG/B,OAASmB,EAAc4C,EAAaR,WAAc,CAG9C,GAAIpC,EAAYzG,WAAa,GAAKyG,IAAgB2C,EAAS,CACvD,SAIJ,GAAI5C,GAAkBC,GAAc,CAChC,SAIJ,GAAIA,EAAYzF,kBAAmBb,GAAkB,CACjDsI,GAAmBhC,EAAYzF,SAInCuG,GAAoBd,EAEpB2C,GAAU3C,EAId,GAAIrD,EAAY,CAEZ,GAAIC,EAAqB,CACrBiG,EAAajI,EAAuBqE,KAAKJ,EAAKrE,cAE9C,OAAOqE,EAAKqE,WAAY,CACpBL,EAAWI,YAAYpE,EAAKqE,iBAE7B,CACHL,EAAahE,EAGjB,GAAIhC,EAAmB,CAMnBgG,EAAahI,EAAWoE,KAAKxF,EAAkBoJ,EAAY,MAG/D,MAAOA,GAGX,MAAOpG,GAAiBoC,EAAKV,UAAYU,EAAKwB,UAUlDlH,GAAUgK,QAAU,SAASd,EAAYe,GACrC,SAAWA,KAAiB,WAAY,CAAE,OAC1CtI,EAAMuH,GAAcvH,EAAMuH,MAC1BvH,GAAMuH,GAAYvE,KAAKsF,GAW3BjK,GAAUkK,WAAa,SAAShB,GAC5B,GAAIvH,EAAMuH,GAAa,CACnBvH,EAAMuH,GAAYN,OAW1B5I,GAAUmK,YAAc,SAASjB,GAC7B,GAAIvH,EAAMuH,GAAa,CACnBvH,EAAMuH,OAUdlJ,GAAUoK,eAAiB,WACvBzI,KAGJ,OAAO3B","file":"./dist/purify.min.js"} \ No newline at end of file +{"version":3,"sources":["./src/purify.js"],"names":["factory","root","window","define","amd","module","exports","DOMPurify","version","removed","document","nodeType","isSupported","originalDocument","DocumentFragment","HTMLTemplateElement","Node","NodeFilter","NamedNodeMap","MozNamedAttrMap","Text","Comment","DOMParser","useDOMParser","template","createElement","content","ownerDocument","implementation","createNodeIterator","getElementsByTagName","createDocumentFragment","importNode","hooks","createHTMLDocument","documentMode","_addToSet","set","array","l","length","toLowerCase","_cloneObj","object","newObject","property","hasOwnProperty","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","SAFE_FOR_JQUERY","SAFE_FOR_TEMPLATES","MUSTACHE_EXPR","ERB_EXPR","WHOLE_DOCUMENT","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_DOM_IMPORT","SANITIZE_DOM","KEEP_CONTENT","FORBID_CONTENTS","DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","CONFIG","formElement","_parseConfig","cfg","ADD_TAGS","ADD_ATTR","ADD_URI_SAFE_ATTR","Object","freeze","_forceRemove","node","push","element","parentNode","removeChild","e","outerHTML","_removeAttribute","name","attribute","getAttributeNode","from","removeAttribute","_initDocument","dirty","doc","body","parseFromString","documentElement","firstElementChild","call","hasAttribute","_createIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","FILTER_ACCEPT","_isClobbered","elm","nodeName","textContent","attributes","setAttribute","_isNode","obj","_sanitizeElements","currentNode","tagName","_executeHook","allowedTags","insertAdjacentHTML","innerHTML","test","cloneNode","replace","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","_sanitizeAttributes","attr","value","lcName","idAttr","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","trim","id","Array","prototype","slice","apply","indexOf","pop","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","entryPoint","data","forEach","hook","sanitize","importedNode","oldNode","nodeIterator","returnNode","toString","TypeError","toStaticHTML","appendChild","firstChild","addHook","hookFunction","removeHook","removeHooks","removeAllHooks"],"mappings":"CAAE,SAASA,GACP,YAEA,IAAIC,SAAcC,UAAW,YAAc,KAAOA,MAElD,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAC5CD,OAAO,WAAY,MAAOH,GAAQC,SAC/B,UAAWI,UAAW,YAAa,CACtCA,OAAOC,QAAUN,EAAQC,OACtB,CACHA,EAAKM,UAAYP,EAAQC,MAE/B,QAASD,GAAQE,GACf,YAEA,IAAIK,GAAY,SAASL,GACrB,MAAOF,GAAQE,GAOnBK,GAAUC,QAAU,OAMpBD,GAAUE,UAEV,KAAKP,IAAWA,EAAOQ,UAAYR,EAAOQ,SAASC,WAAa,EAAG,CAG/DJ,EAAUK,YAAc,KACxB,OAAOL,GAGX,GAAIG,GAAWR,EAAOQ,QACtB,IAAIG,GAAmBH,CACvB,IAAII,GAAmBZ,EAAOY,gBAC9B,IAAIC,GAAsBb,EAAOa,mBACjC,IAAIC,GAAOd,EAAOc,IAClB,IAAIC,GAAaf,EAAOe,UACxB,IAAIC,GAAehB,EAAOgB,cAAgBhB,EAAOiB,eACjD,IAAIC,GAAOlB,EAAOkB,IAClB,IAAIC,GAAUnB,EAAOmB,OACrB,IAAIC,GAAYpB,EAAOoB,SACvB,IAAIC,GAAe,KAQnB,UAAWR,KAAwB,WAAY,CAC3C,GAAIS,GAAWd,EAASe,cAAc,WACtC,IAAID,EAASE,SAAWF,EAASE,QAAQC,cAAe,CACpDjB,EAAWc,EAASE,QAAQC,eAGpC,GAAIC,GAAiBlB,EAASkB,cAC9B,IAAIC,GAAqBnB,EAASmB,kBAClC,IAAIC,GAAuBpB,EAASoB,oBACpC,IAAIC,GAAyBrB,EAASqB,sBACtC,IAAIC,GAAanB,EAAiBmB,UAElC,IAAIC,KAKJ1B,GAAUK,kBACCgB,GAAeM,qBAAuB,aAC7CxB,EAASyB,eAAiB,CAG9B,IAAIC,GAAY,SAASC,EAAKC,GAC1B,GA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F,kBAAmBZ,GAAkB,CACjDsI,GAAmBhC,EAAY1F,SAInCwG,GAAoBd,EAEpB2C,GAAU3C,EAId,GAAItD,EAAY,CAEZ,GAAIC,EAAqB,CACrBkG,EAAalI,EAAuBqE,KAAKJ,EAAKrE,cAE9C,OAAOqE,EAAKsE,WAAY,CACpBL,EAAWI,YAAYrE,EAAKsE,iBAE7B,CACHL,EAAajE,EAGjB,GAAIhC,EAAmB,CAMnBiG,EAAajI,EAAWoE,KAAKvF,EAAkBoJ,EAAY,MAG/D,MAAOA,GAGX,MAAOrG,GAAiBoC,EAAKV,UAAYU,EAAKyB,UAUlDlH,GAAUgK,QAAU,SAASd,EAAYe,GACrC,SAAWA,KAAiB,WAAY,CAAE,OAC1CvI,EAAMwH,GAAcxH,EAAMwH,MAC1BxH,GAAMwH,GAAYxE,KAAKuF,GAW3BjK,GAAUkK,WAAa,SAAShB,GAC5B,GAAIxH,EAAMwH,GAAa,CACnBxH,EAAMwH,GAAYN,OAW1B5I,GAAUmK,YAAc,SAASjB,GAC7B,GAAIxH,EAAMwH,GAAa,CACnBxH,EAAMwH,OAUdlJ,GAAUoK,eAAiB,WACvB1I,KAGJ,OAAO1B","file":"./dist/purify.min.js"} \ No newline at end of file diff --git a/package.json b/package.json index 1977d9dc1..a5d0a3170 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "name": "dompurify", "description": "DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's written in JavaScript and works in all modern browsers (Safari, Opera (15+), Internet Explorer (10+), Firefox and Chrome - as well as almost anything else using Blink or WebKit). DOMPurify is written by security people who have vast background in web attacks and XSS. Fear not.", - "version": "0.8.6", + "version": "0.8.7", "main": "src/purify.js", "directories": { "test": "test" diff --git a/src/purify.js b/src/purify.js index 6175dfdb7..2f74d5df4 100644 --- a/src/purify.js +++ b/src/purify.js @@ -21,7 +21,7 @@ * Version label, exposed for easier checks * if DOMPurify is up to date or not */ - DOMPurify.version = '0.8.6'; + DOMPurify.version = '0.8.7'; /** * Array of elements that DOMPurify removed during sanitation. diff --git a/website/index.html b/website/index.html index 1ba56c5b2..9b154b11e 100644 --- a/website/index.html +++ b/website/index.html @@ -2,7 +2,7 @@ - DOMPurify 0.8.6 "Thanks Safari" + DOMPurify 0.8.7 "Naughty Narwal" @@ -23,7 +23,7 @@ -

DOMPurify 0.8.6 "Thanks Safari"

+

DOMPurify 0.8.7 "Naughty Narwal"

Bower version · npm version · Build Status