%
' -------------------------------------------------------------------
' File: SSECommon.asp
'
' Copyright (c) 2003 DPA Software. All rights reserved.
' -------------------------------------------------------------------
' -------------------------------------------------------------------
' Constants / Globals
' -------------------------------------------------------------------
nl = Chr(13) & Chr(10) ' cr lf
lf = Chr(10) 'lf
cr = Chr(13) 'cr
sp = Chr(32) 'space
qt = Chr(34) 'quote
ns = Chr(35) 'number sign
ap = Chr(39) 'apostrophe
cm = Chr(44) 'comma
tb = Chr(09) 'tab
vt = Chr(11) 'vertical tab
ff = Chr(12) 'form feed
' -------------------------------------------------------------------
' RemoveSharedBorders
'
' Removes FP Shared Borders from text using tags
' Warning: will unbalance table tags
' -------------------------------------------------------------------
Function RemoveSharedBorders ( byval strText )
'first read the shared border meta tag
loc = InStr(strText, "")
RemoveSharedBorders = MyArray(segment)
End Function
' -------------------------------------------------------------------
' RemoveCode
'
' Removes specifed script tag from the text
' -------------------------------------------------------------------
Function RemoveCode ( byval strText, byval sStart, byval sEnd )
sText = strText
do while 1
s = InStr ( 1, sText, sStart, 1 )
if s = 0 then exit do
e = InStr ( s+1, sText, sEnd, 1 )
if e = 0 then
sText = left ( sText, s-1 )
exit do
else
sText = left ( sText, s-1 ) & Mid ( sText, e+len(sEnd) )
end if
loop
RemoveCode = sText
end function
' -------------------------------------------------------------------
' RemoveHTML
'
' Removes HTML tags and illegal chars from text
' -------------------------------------------------------------------
Function RemoveHTML ( byval strText, byval ext )
Dim RegEx
strText = Replace(strText, "
", sp)
strText = Replace(strText, nl, sp)
select case lcase(ext)
case "asp", "aspx", "jsp"
strText = RemoveCode ( strText, "<" & "%", "%" & ">" )
case "php", "php3"
strText = RemoveCode ( strText, "", "?>" )
end select
strText = RemoveCode ( strText, "