Fix rendering might result XSS attribute on self closing tag [Security Issue]
This commit is contained in:
@@ -551,6 +551,19 @@ export function postProcess (code) {
|
||||
}
|
||||
window.postProcess = postProcess
|
||||
|
||||
var domevents = Object.getOwnPropertyNames(document).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(Object.getPrototypeOf(document)))).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(window))).filter(function (i) {
|
||||
return !i.indexOf('on') && (document[i] === null || typeof document[i] === 'function')
|
||||
}).filter(function (elem, pos, self) {
|
||||
return self.indexOf(elem) === pos
|
||||
})
|
||||
|
||||
export function removeDOMEvents (view) {
|
||||
for (var i = 0, l = domevents.length; i < l; i++) {
|
||||
view.find('[' + domevents[i] + ']').removeAttr(domevents[i])
|
||||
}
|
||||
}
|
||||
window.removeDOMEvents = removeDOMEvents
|
||||
|
||||
function generateCleanHTML (view) {
|
||||
const src = view.clone()
|
||||
const eles = src.find('*')
|
||||
|
||||
Reference in New Issue
Block a user