=============================================================
''函数作用:判断来源URL是否来自外部
''=============================================================
Public Function CheckOuterUrl()
On Error Resume Next
Dim server_v1, server_v2
server_v1 = Replace(LCase(Trim(Request.ServerVariables("HTTP_REFERER"))), "http://", "")
server_v2 = LCase(Trim(Request.ServerVariables("SERVER_NAME")))
If server_v1 <> "" And Left(server_v1, Len(server_v2)) <> server_v2 Then
CheckOuterUrl = False
Else
CheckOuterUrl = True
End If
End Function
''================================================
''函数名:GotTopic
''作 用:显示字符串长度
''参 数:str ----原字符串
'' strlen ----显示字符长度
''================================================
Public Function GotTopic(ByVal str, ByVal strLen)
Dim l, t, c, i
Dim strTemp
On Error Resume Next
str = Trim(str)
str = Replace(str, " ", " ")
str = Replace(str, ">", ">")
str = Replace(str, "<", "<")
str = Replace(str, ">", ">")
str = Replace(str, "<", "<")
str = Replace(str, "'", "''")
str = Replace(str, """, Chr(34))
str = Replace(str, vbNewLine, "")
l = Len(str)
t = 0
For i = 1 To l
c = Abs(Asc(Mid(str, i, 1)))
If c > 255 Then
t = t + 2
Else
t = t + 1
End If
If t >= strLen Then
strTemp = Left(str, i) & "..."
Exit For
Else
strTemp = str & " "
End If
Next
GotTopic = CheckTopic(strTemp)
End Function
Public Function CheckTopic(ByVal strContent)
Dim re
On Error Resume Next
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.Pattern = "(<s+cript(.+?)<\/s+cript>)"
strContent = re.Replace(strContent, "")
re.Pattern = "(<iframe(.+?)<\/iframe>)"
strContent = re.Replace(strContent, "")
re.Pattern = "(>)"
strContent = re.Replace(strContent, ">")
re.Pattern = "(<)"
strContent = re.Replace(strContent, "<")
Set re = Nothing
strContent = Replace(strContent, ">", ">")
strContent = Replace(strContent, "<", "<")
strContent = Replace(strContent, "''", "'")
strContent = Replace(strContent, Chr(34), """)
strContent = Replace(strContent, "%", "%")
strContent = Replace(strContent, vbNewLine, "")
CheckTopic = Trim(strContent)
End Function
''================================================
''函数名:ReadTopic
''作 用:显示字符串长度
''参 数:str ----原字符串
'' strlen ----显示字符长度
''==========