Created
May 23, 2012 22:43
-
-
Save pedroelsner/2778297 to your computer and use it in GitHub Desktop.
Utilização da clase Sanitize
This file contains hidden or 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 | |
// Importa a classe necessária | |
require_once('sanitize.php'); | |
// Filtra HTML e SQL Injection em todos os campos | |
$_GET = Sanitize::filter($_GET); | |
$_POST = Sanitize::filter($_POST); | |
// Somente HTML Injection | |
$_POST = Sanitize::filter($_POST, array('html')); | |
// Somente SQL Injection | |
$_POST = Sanitize::filter($_POST, array('sql')); | |
// Campos | |
$_GET['campo'] = Sanitize::filter($_GET['campo']); | |
$_POST['campo'] = Sanitize::filter($_POST['campo']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment