En mi tiempo libre elabore este codigo , que creo me filtra todo posible intento de ataque.
Código PHP:
public function CleanVar($var)
{
if (!isset($var)) {
$var=htmlentities(htmlspecialchars(trim(addslashes($var))));
$bad_words=array("UNION","LEFT","JOIN","=","='","?","==","=","===");
$var=str_replace($bad_words,"",$var);
return $var;
}
}
Desde ya gracias.!