1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Vbscript to Remove Malicious HTML

Discussion in 'C#' started by directorycollector, Nov 23, 2006.

  1. #1
    Does anybody know where I can find a script for removing potentially malicious html tags or atributes from submitted HTML?
     
    directorycollector, Nov 23, 2006 IP
  2. doronty37

    doronty37 Active Member

    Messages:
    130
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Filter function from Web Wiz Forum:

    <%
    'Format SQL Query funtion
    Private Function formatSQLInput(ByVal strInputEntry)
    
    	'Remove malisous charcters from sql
    	strInputEntry = Replace(strInputEntry, """", "", 1, -1, 1)
    	strInputEntry = Replace(strInputEntry, "'", "''", 1, -1, 1)
    	strInputEntry = Replace(strInputEntry, "[", "&#091;", 1, -1, 1)
    	strInputEntry = Replace(strInputEntry, "]", "&#093;", 1, -1, 1)
    	strInputEntry = Replace(strInputEntry, "<", "&lt;", 1, -1, 1)
    	strInputEntry = Replace(strInputEntry, ">", "&gt;", 1, -1, 1)
    	
    	'Return
    	formatSQLInput = strInputEntry
    End Function %>
    Code (markup):
     
    doronty37, Nov 23, 2006 IP
    YIAM likes this.