26 lines
829 B
Plaintext
26 lines
829 B
Plaintext
<%
|
|
function clearJS(str)
|
|
clearJS = str
|
|
Set regEx = New RegExp
|
|
'This gets rid of onclick and such
|
|
oncmds = "Click|DblClick|KeyDown|KeyPress|KeyUp|MouseDown"&_
|
|
"|MouseMove|MouseOut|MouseOver|MouseUp"
|
|
regEx.Pattern = "(on("& oncmds &")[^>])"
|
|
regEx.IgnoreCase = True
|
|
regEx.Global = True
|
|
clearJS = regEx.Replace(clearJS, "")
|
|
'This takes out the ability to use javas
|
|
' cript: with href
|
|
clearJS = Replace(clearJS, "javascript:", "")
|
|
'This clears out < script > tags
|
|
regEx.Pattern = "(<[s]c[^>]*>)"
|
|
regEx.IgnoreCase = True
|
|
regEx.Global = True
|
|
clearJS = regEx.Replace(clearJS, "")
|
|
regEx.Pattern = "(</[s]c[^>]*>)"
|
|
regEx.IgnoreCase = True
|
|
regEx.Global = True
|
|
clearJS = regEx.Replace(clearJS, "")
|
|
End function
|
|
%>
|