I know this is a .Net forum, put I have an ASP Classic question that I am hoping someone could help me on. I want to sanitize for XSS scripting and want to convert my ASP Regex
<%
Function Is_Mobile()
Set Regex = New RegExp
With Regex
.Pattern = "(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|windows ce|pda|mobile|mini|palm|ipad|Android)"
.IgnoreCase = True
.Global = True
End With
Match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
If Match then
Is_Mobile = True
Else
Is_Mobile = False
End If
End Function
%>
<%if Is_Mobile() then
response.write "something"
response.End
end if
%>
So I want the pattern to be bad character and place them in .Pattern. Like (script|execute\s) …and others.
For me to mirror image that code I need to change
Match = Regex.test(Request.ServerVariables("HTTP_USER_AGENT"))
to something else - WHICH IS WHAT I CAN’T SEEM TO DO.
Any help would be appreciate or even a better Regex.
Thanks