复制代码 代码如下:
<%
Public Function UbbCode(strContent)
Dim re
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
'过滤危险脚本
re.Pattern = "(</script>)"
strContent = re.Replace(strContent, "</script>")
re.Pattern = "(script:)"
strContent = re.Replace(strContent, "s cript:")
re.Pattern = "(script)"
strContent = re.Replace(strContent, "s cript")
re.Pattern = "(js:)"
strContent = re.Replace(strContent, "js:")
re.Pattern = "(value)"
strContent = re.Replace(strContent, "value")
re.Pattern = "(about:)"
strContent = re.Replace(strContent, "about:")
re.Pattern = "(file:)"
strContent = re.Replace(strContent, "file:")
re.Pattern = "(document.cookie)"
strContent = re.Replace(strContent, "documents.cookie")
re.Pattern = "(vbs:)"
strContent = re.Replace(strContent, "v bs:")
re.Pattern = "(on(mouse|exit|error|click|key))"
strContent = re.Replace(strContent, "on$2")
re.Pattern = "<IMG.[^>]*SRC(=| )(.[^>]*)>"
'strContent = re.replace(strContent,"<IMG SRC=$2 onclick=""javascript:window.open(this.src);"" style=""CURSOR: pointer"" border=""0"">")
strContent = re.replace(strContent,"<IMG SRC=$2 border=""0"">")
're.Pattern="<img(.[^>]*)>"
内容版权声明:除非注明,否则皆为本站原创文章。