<!--#Include File="Dv_ClsMain.asp"-->
<%
Set MyBoardOnline=new Cls_UserOnlne 
Dvbbs.GetForum_Setting
'别的系统转入论坛
Dvbbs.CheckUserLogin

Function checkXHTML(XMLstr)
	Dim XML,node
	Set xml=Server.Createobject("msxml2.DOMDocument"& MsxmlVersion)
	If xml.loadxml("<div>" & replace(XMLstr,"&","&amp;") &"</div>") Then
		checkXHTML=""
		If xml.documentElement.getElementsByTagName("link").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""link"""
			Exit Function
		End If
		If xml.documentElement.getElementsByTagName("iframe").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""iframe"""
			Exit Function
		End If
		If xml.documentElement.getElementsByTagName("meta").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""meta"""
			Exit Function
		End If
		If xml.documentElement.getElementsByTagName("script").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""script"""
			Exit Function
		End If
		If xml.documentElement.getElementsByTagName("object").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""object"""
			Exit Function
		End If
		If xml.documentElement.getElementsByTagName("embed").length >0 Then
			checkXHTML="数据含前台禁止提交的标签""embed"""
			Exit Function
		End If
		'href里的脚本
		For Each Node in xml.documentElement.selectNodes("//a[@href]")
			If InStr(LCase(Node.selectSingleNode("@href").text),"script:")>0  Then
				checkXHTML="超级链接中含非法的脚本代码"
				Exit For
			End If
		Next
		If checkXHTML<>"" Then Exit Function
		'过滤src里的脚本
		For Each Node in xml.documentElement.selectNodes("//*[@src]")
			If InStr(LCase(Node.selectSingleNode("@src").text),"script:")>0  Then
				checkXHTML="图片地址中包含脚本命令"
				Exit For
			End If
		Next
		If checkXHTML<>"" Then Exit Function
		'所有的事件属性
		For Each Node in xml.documentElement.selectNodes("//@*")
			If Left(Node.nodeName,2)="on" Then
				checkXHTML="数据含前台禁止提交的属性"
				Exit For
			End If
		Next
	Else
		checkXHTML="数据无法校验，数据不合法"
	End If
End Function
%>