Skip to content

Instantly share code, notes, and snippets.

@jacoborus
Created November 2, 2012 09:02
Show Gist options
  • Save jacoborus/3999612 to your computer and use it in GitHub Desktop.
Save jacoborus/3999612 to your computer and use it in GitHub Desktop.
Proteger PHP frente a inyecciones
<?php
function protege($texto) {
$texto = str_replace("'", "\'", $texto);
$texto = htmlspecialchars ($texto);
$texto = htmlentities ($texto);
$texto = trim ($texto);
return $texto;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment