Skip to content

Commit dbadb85

Browse files
author
Weedshaker
committed
regex fix
1 parent 3dbc2af commit dbadb85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Shadow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ export const Shadow = (ChosenHTMLElement = HTMLElement) => class Shadow extends
784784
static htmlPurify (html) {
785785
// first sanitize tags eg.: <img src="xyz" onload=alert('XSS')>, <img src="xyz" onmouseover=alert('XSS')>, <image/src/onerror=alert('XSS')>, etc.
786786
// second sanitize tags eg.: <a href="javascript:alert(document.location);">XSS</a>, <form action="javascript:alert(document.location);"><input type="submit" /></form>, etc.
787-
return html.replace(/<[a-zA-z]*[\s|\/][^>]*on[a-zA-z]{4,10}=[^>]*>/g, '').replace(/<[a-zA-z]*[\s|\/][^>]*javascript:[^>]*>/g, '')
787+
return html.replace(/<[a-z]*[\s|\/][^>]*on[a-z]{4,10}=[^>]*>/gi, '').replace(/<[a-z]*[\s|\/][^>]*javascript:[^>]*>/gi, '')
788788
}
789789

790790
// display trumps hidden property, which we resolve here as well as we allow an animation on show

0 commit comments

Comments
 (0)