suppression de certains mots clés SQL
Hello, je suis en train de créer une petite fonction perso pour supprimer certains mots-clés SQL , voici ce que j'ai actuellement :
Code:
$string = eregi_replace("[^:alpha:](select)|(drop)|(update)|(alter)|(create)|(insert)|(grant)|(revoke)[^:alpha:]", "", $string);
Mes phrases de test :
Code:
1 2 3
| $_POST["toto"] = " selection; select * from users;select * from users;";
$_POST["tot2o"] = "drop table toto; droppy !";
$_POST["tot2o3"] = " grant * on users; grannt"; |
Actuellement ça me sort ça apres traitement :
Code:
[toto] => selection; * from users * from users; [tot2o] => table toto; py ! [tot2o3] => * on users; grannt
Il manque pas grand chose mais le mot clé "DROP" pose probleme là, vous voyez d'où ça peut venir?
merci.