Skip to content

Instantly share code, notes, and snippets.

@pedroelsner
Created May 23, 2012 22:43
Show Gist options
  • Save pedroelsner/2778297 to your computer and use it in GitHub Desktop.
Save pedroelsner/2778297 to your computer and use it in GitHub Desktop.
Utilização da clase Sanitize
<?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