'********************************************
'*** Format Links *****
'********************************************
'Format links funtion
Private Function formatLink(ByVal 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, "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, "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, "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, "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, "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, "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)
'Return
formatLink = strInputEntry
End Function |