<%
'***********************************
'Função: checkstr (byvalchkstr)
'Parâmetro: Chkstr, personagem a ser verificado
'Autor: Alixi
Data: 2007/7/15
'Descrição: Reencode os caracteres perigosos de injeção de SQL
'Exemplo: checkstr ("e1 = 1Select*de")
'***********************************
FunctionCheckstr (Byvalchkstr)
DIMSTR: STR = CHKSTR
STR = TRIM (STR)
Ifisnull (str) Então
Checkstr = ""
Saída de saída
Endif
Dimre
Setre = newRegexp
re.IGNORECASE = true
re.global = true
re.pattern = "(/r/n) {3,}"
Str = re.Place (str, "$ 1 $ 1 $ 1")
Setre = nada
Str = substituir (str, "'", "' '")
Str = substituir (str, "selecionar", "selecionar")
Str = substituir (str, "junção", "junção")
Str = substituir (str, "união", "união")
Str = substituir (str, "onde", "onde")
Str = substituir (str, "inserir", "inserir")
Str = substituir (str, "delete", "excluir")
Str = substituir (str, "atualização", "atualização")
Str = substituir (str, "como", "como")
Str = substitua (str, "gota", "gota")
Str = substituir (str, "Criar", "Criar")
Str = substituir (str, "modificar", "modificar")
Str = substituir (str, "renomear", "renomear")
Str = substituir (str, "alter", "alter")
Str = substituir (str, "elenco", "elenco")
Checkstr = str
Função final
'Descompile a string processada pela função acima
Functionuncheckstr (str)
Str = substituir (str, "selecionar", "selecionar")
Str = substituir (str, "junção", "junção")
Str = substituir (str, "união", "união")
Str = substituir (str, "onde", "onde")
Str = substituir (str, "inserir", "inserir")
Str = substituir (str, "delete", "excluir")
Str = substituir (str, "atualização", "atualização")
Str = substituir (str, "como", "como")
Str = substitua (str, "gota", "gota")
Str = substituir (str, "Criar", "Criar")
Str = substituir (str, "modificar", "modificar")
Str = substituir (str, "renomear", "renomear")
Str = substituir (str, "alter", "alter")
Str = substituir (str, "elenco", "elenco")