%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Guide - Web Wiz Forums
'**
'** Copyright 2001-2002 Bruce Corkhill All Rights Reserved.
'**
'** This program is free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may use parts of this program in your own private work, but you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** You should have received a copy of the License along with this program;
'** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'** No official support is available for this program but you may post support questions at: -
'** http://www.webwizguide.info/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -
'** info@webwizguide.com
'**
'** or at: -
'**
'** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom
'**
'****************************************************************************************
'Check images function
Private Function checkImages(strInputEntry)
Dim strTempInnerMessageLink
Dim strInnerMessageLink
Dim strImageFileExtension
Dim strInputEntryLink
'Encode image links to stop malcious code
Do While NOT InStr(1, strInputEntry, "src=""", 1) = 0
'Find the start position in the message of the
closing tag
lngLinkEndPos = InStr(lngLinkStartPos, strInputEntry, ">", 1) + 1
'Make sure the end position is not in error
If lngLinkEndPos - lngLinkStartPos =< 5 Then lngLinkEndPos = lngLinkStartPos + 5
'Read in the code to be be checked
strInputEntryLink = Trim(Mid(strInputEntry, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))
'If the > end postition is more than 6 then there is one so get the inputed link
If lngLinkEndPos > (lngLinkStartPos + 5) Then
'Start position inside the link tag the actual input starts
lngLinkStartPos = 6
'Find the position in the message for the url > closing tag
lngLinkEndPos = InStr(lngLinkStartPos, strInputEntryLink, ">", 1)
'Place the image path in the image tag into a string
strInnerMessageLink = Trim(Mid(strInputEntryLink, 6, (lngLinkEndPos - lngLinkStartPos)))
End If
'Place the message link into the tempoary message variable
strTempMessageLink = strInputEntryLink
strTempInnerMessageLink = strInnerMessageLink
'Format the link into an HTML hyperlink
strTempMessageLink = Replace(strTempMessageLink, "src=""", "src= """, 1, -1, 1)
'If there is no . in the link then there is no extenison and so can't be an image
If inStr(1, strTempInnerMessageLink, ".", 1) = 0 Then
strTempInnerMessageLink = """"
'Else remove malicious code and check the extension is an image extension
Else
'Call the format link function to strip malicious codes
strTempInnerMessageLink = formatLink(strTempInnerMessageLink)
'Strip any pages that try to sneak in
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".htm", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".asp", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".php", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".php3", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".php4", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".aspx", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".ascx", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".asmx", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".vs", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".config", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".asmx", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".jsp", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".jst", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".cgi", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".cfm", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".cfml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".cfc", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".shtml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".ihtml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".java", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".wml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".vbs", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".vtm", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".vtml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".edml", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".pm", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".js", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".inc", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".txt", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".wave", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".exe", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, ".hqx", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "?", "", 1, -1, 1)
'Get the file extension
strImageFileExtension = LCase(Right(strTempInnerMessageLink, (Len(strTempInnerMessageLink)-((InstrRev(strTempInnerMessageLink, ".")-1)))))
'strImageFileExtension = Mid(strInputEntryLink, (InstrRev(strTempInnerMessageLink, ".")-1), (InstrRev(strTempInnerMessageLink, ".")+3))
'Check the file extension if it's not a web graphic then remove the extension
If NOT (strImageFileExtension = ".gif" OR strImageFileExtension = ".jpg" OR strImageFileExtension = ".jpe" OR strImageFileExtension = ".bmp" OR strImageFileExtension = ".png") Then
'See if there is a valid image extension in there somewhere if there is chop the rest and keep the image extension
If Instr(LCase(strTempInnerMessageLink), ".gif") Then
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, ".gif", 1, -1, 1)
ElseIf Instr(LCase(strTempInnerMessageLink), ".jpg") Then
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, ".jpg", 1, -1, 1)
ElseIf Instr(LCase(strTempInnerMessageLink), ".jpe") Then
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, ".jpeg", 1, -1, 1)
ElseIf Instr(LCase(strTempInnerMessageLink), ".bmp") Then
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, ".bmp", 1, -1, 1)
ElseIf Instr(LCase(strTempInnerMessageLink), ".png") Then
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, ".png", 1, -1, 1)
'Else there is no valid image extension in there so chop the lot
Else
strTempInnerMessageLink = Replace(strTempInnerMessageLink, strImageFileExtension, "", 1, -1, 1)
End If
End If
End If
'Place the newly formated image into the tempery image tag
strTempMessageLink = Replace(strTempMessageLink, strInnerMessageLink, strTempInnerMessageLink, 1, -1, 1)
'Make sure the tag is closed
If inStr(1, strTempMessageLink, """>", 1) = 0 AND inStr(1, strTempMessageLink, "'>", 1) = 0 Then strTempMessageLink = Replace(strTempMessageLink, ">", """>", 1, -1, 1)
'Place the new fromatted hyperlink into the message string body
strInputEntry = Replace(strInputEntry, strInputEntryLink, strTempMessageLink, 1, -1, 1)
Loop
'Return
checkImages = strInputEntry
End Function
'Check links function
Private Function checkLinks(strInputEntry)
Dim strTempInnerMessageLink
Dim strInnerMessageLink
Dim strImageFileExtension
Dim strInputEntryLink
'Encode URL links to stop malcious code
Do While NOT InStr(1, strInputEntry, "href=""", 1) = 0
'Find the start position in the message of the
closing tag
lngLinkEndPos = InStr(lngLinkStartPos, strInputEntry, "", 1) + 4
'Make sure the end position is not in error
If lngLinkEndPos - lngLinkStartPos =< 6 Then lngLinkEndPos = lngLinkStartPos + 6
'Read in the code to be be checked
strInputEntryLink = Trim(Mid(strInputEntry, lngLinkStartPos, (lngLinkEndPos - lngLinkStartPos)))
'If the > end postition is more than 6 then there is one so get the inputed link
If lngLinkEndPos > (lngLinkStartPos + 6) Then
'Start position inside the link tag the actual input starts
lngLinkStartPos = 7
'Find the position in the message for the url > closing tag
lngLinkEndPos = InStr(lngLinkStartPos, strInputEntryLink, "", 1)
'Place the image path in the image tag into a string
strInnerMessageLink = Trim(Mid(strInputEntryLink, 7, (lngLinkEndPos - lngLinkStartPos)))
End If
'Place the message link into the tempoary message variable
strTempMessageLink = strInputEntryLink
strTempInnerMessageLink = strInnerMessageLink
'Format the link into an HTML hyperlink
strTempMessageLink = Replace(strTempMessageLink, "href=""", "href= """, 1, -1, 1)
'Remove font formating from the link as it may course the link to display incorrectly
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "serif"">", "serif", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "mono"">", "mono", 1, -1, 1)
'Turn the end "> into a code so it don't get striped
strTempInnerMessageLink = Replace(strTempInnerMessageLink, """>", "*/*\*", 1, -1, 1)
'Call the format link function to strip malicious codes
strTempInnerMessageLink = formatLink(strTempInnerMessageLink)
'Turn the end code into back into "> so it knows which bit is the href
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "*/*\*", """>", 1, -1, 1)
'Remove font formating from the link as it may course the link to display incorrectly
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "face=Arial, Helvetica, sans-serif", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "face=Courier New, Courier, mono", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "face=Times New Roman, Times, serif", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "face=Verdana, Arial, Helvetica, sans-serif", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=black", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=white", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=blue", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=red", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=green", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=yellow", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=orange", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=brown", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=magenta", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=cyan", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "color=limegreen", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=1", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=2", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=3", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=4", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=5", "", 1, -1, 1)
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "size=6", "", 1, -1, 1)
'If there is an image in the link reformat it back again
strTempInnerMessageLink = Replace(strTempInnerMessageLink, "img border=0 src=", "
", 1) = 0 AND inStr(1, strTempMessageLink, "'>", 1) = 0 Then strTempMessageLink = Replace(strTempMessageLink, ">", """>", 1, -1, 1)
'Place the new fromatted hyperlink into the message string body
strInputEntry = Replace(strInputEntry, strInputEntryLink, strTempMessageLink, 1, -1, 1)
Loop
'Return
checkLinks = strInputEntry
End Function
'Format user input function
Private Function formatInput(strInputEntry)
'Get rid of malicous code in the message
strInputEntry = Replace(strInputEntry, "script", "script", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "SCRIPT", "SCRIPT", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Script", "Script", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "script", "Script", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "style", "style", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "STYLE", "STYLE", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Style", "Style", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "style", "Stylet", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "object", "object", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "OBJECT", "OBJECT", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Object", "Object", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "object", "Object", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "applet", "applet", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "APPLET", "APPLET", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Applet", "Applet", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "applet", "Applet", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "embed", "embed", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "EMBED", "EMBED", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Embed", "Embed", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "embed", "Embed", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "event", "event", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "EVENT", "EVENT", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Event", "Event", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "event", "Event", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "document", "document", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "DOCUMENT", "DOCUMENT", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Document", "Document", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "document", "Document", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "cookie", "cookie", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "COOKIE", "COOKIE", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Cookie", "Cookie", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "cookie", "Cookie", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "form", "form", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "FORM", "FORM", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Form", "Form", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "form", "Form", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "iframe", "iframe", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "IFRAME", "IFRAME", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Iframe", "Iframe", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "iframe", "iframe", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "on", "on", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "ON", "ON", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "On", "On", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "on", "on", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "%", "%", 1, -1, 1)
'Reformat a few bits
strInputEntry = Replace(strInputEntry, "", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "font", "font", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "FONT", "FONT", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Font", "Font", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "fOnt", "font", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "font", "font", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "mono", "mono", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "MONO", "MONO", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "MOno", "Mono", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "mOno", "mono", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "mono", "mono", 1, -1, 1)
'Return
formatInput = strInputEntry
End Function
'Format links funtion
Private Function formatLink(strInputEntry)
'Remove malisous charcters from links and images
strInputEntry = Replace(strInputEntry, "document.cookie", ".", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "javascript:", "javascript ", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "vbscript:", "vbscript ", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "(", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, ")", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "[", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "]", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "{", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "}", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "<", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, ">", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "|", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, """", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "'", " ", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "script", "script", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "object", "object", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "applet", "applet", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "embed", "embed", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "document", "document", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "cookie", "cookie", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "event", "event", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "on", "on", 1, -1, 1)
'Return
formatLink = strInputEntry
End Function
'Format SQL Query funtion
Private Function formatSQLInput(strInputEntry)
'Remove malisous charcters from links and images
strInputEntry = Replace(strInputEntry, "<", "<")
strInputEntry = Replace(strInputEntry, ">", ">")
strInputEntry = Replace(strInputEntry, """", "", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "'", "''", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "select", "select", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "join", "join", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "union", "union", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "where", "where", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "insert", "insert", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "delete", "delete", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "update", "update", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "like", "like", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "drop", "drop", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "create", "create", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "modify", "modify", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "rename", "rename", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "alter", "alter", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "cast", "cast", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "pass", "pass", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "code", "code", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "author", "author", 1, -1, 1)
strInputEntry = Replace(strInputEntry, "username", "username", 1, -1, 1)
'Return
formatSQLInput = strInputEntry
End Function
'Decode encoded strings
Private Function decodeString(strInputEntry)
'Remove malisous charcters from links and images
strInputEntry = Replace(strInputEntry, "=", "=", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "a", "a", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "b", "b", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "c", "c", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "d", "d", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "e", "e", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "f", "f", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "g", "g", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "h", "h", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "i", "i", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "j", "j", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "k", "k", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "l", "l", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "m", "m", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "n", "n", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "o", "o", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "p", "p", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "q", "q", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "r", "r", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "s", "s", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "t", "t", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "u", "u", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "v", "v", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "w", "w", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "x", "x", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "y", "y", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "z", "z", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "A", "A", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "B", "B", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "C", "C", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "D", "D", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "E", "E", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "F", "F", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "G", "G", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "H", "H", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "I", "I", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "J", "J", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "K", "K", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "L", "L", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "M", "M", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "N", "N", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "O", "O", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "P", "P", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Q", "Q", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "R", "R", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "S", "S", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "T", "T", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "U", "U", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "V", "V", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "W", "W", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "X", "X", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Y", "Y", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "Z", "Z", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "0", "0", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "1", "1", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "2", "2", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "3", "3", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "4", "4", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "5", "5", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "6", "6", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "7", "7", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "8", "8", 1, -1, 0)
strInputEntry = Replace(strInputEntry, "9", "9", 1, -1, 0)
'Return
decodeString = strInputEntry
End Function
%>