Created
March 8, 2012 01:56
-
-
Save danilowm/1997988 to your computer and use it in GitHub Desktop.
Função Anti SQL Injection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Anti Injection | |
* Verifica e Trata as informações | |
* Autor: Danilo Iannone - [email protected] | |
*/ | |
function anti_injection( $obj ) { | |
$obj = preg_replace("/(from|alter table|select|insert|delete|update|where|drop table|show tables|#|*|--|\\)/i", "", $obj); | |
$obj = trim($obj); | |
$obj = strip_tags($obj); | |
if(!get_magic_quotes_gpc()) { | |
$obj = addslashes($obj); | |
return $obj; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment