<%
'*******************************
'Fonction: Checktr (byValchkstr)
'Paramètre: chktr, caractère à vérifier
'Auteur: Alixi
'Date: 2007/7/15
'Description: réencoder les caractères dangereux de l'injection SQL
'Exemple: Checktr ("et1 = 1Orselect * de")
'*******************************
FonctionChecktr (ByValchkstr)
Dimstr: str = chktr
Str = trim (str)
Ifisnull (str) puis
Checkstr = ""
Sortie
Endire
Tabac
SetRe = newRegexp
re.ignorecase = true
re.global = true
re.Pattern = "(/ r / n) {3,}"
Str = re.replace (Str, "1 $ 1 $ 1 $")
Setdre = rien
Str = remplacer (str, "'", "' '")
Str = remplacer (str, "sélectionner", "select")
Str = remplacer (str, "join", "join")
Str = remplacer (Str, "Union", "Union")
Str = remplacer (str, "où", "où")
Str = remplacer (str, "insérer", "insérer")
Str = remplacer (str, "supprimer", "supprimer")
Str = remplacer (str, "mise à jour", "mise à jour")
Str = remplacer (str, "like", "like")
Str = remplacer (str, "drop", "drop")
Str = remplacer (str, "créer", "créer")
Str = remplace (str, "modifier", "modifier")
Str = remplacer (str, "renommer", "renommer")
Str = remplacer (str, "alter", "alter")
Str = remplacer (str, "cast", "cast")
Checkstr = str
Finition de fin
'Décompiler la chaîne traitée par la fonction ci-dessus
FunctionChunSckstr (STR)
Str = remplacer (str, "sélectionner", "select")
Str = remplacer (str, "join", "join")
Str = remplacer (Str, "Union", "Union")
Str = remplacer (str, "où", "où")
Str = remplacer (str, "insérer", "insérer")
Str = remplacer (str, "supprimer", "supprimer")
Str = remplacer (str, "mise à jour", "mise à jour")
Str = remplacer (str, "like", "like")
Str = remplacer (str, "drop", "drop")
Str = remplacer (str, "créer", "créer")
Str = remplace (str, "modifier", "modifier")
Str = remplacer (str, "renommer", "renommer")
Str = remplacer (str, "alter", "alter")
Str = remplacer (str, "cast", "cast")