Skip to content

Instantly share code, notes, and snippets.

@klette
Created May 29, 2009 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klette/119882 to your computer and use it in GitHub Desktop.
Save klette/119882 to your computer and use it in GitHub Desktop.
<?php
$untaint = new Untainter();
class MyImageUntainter {
function validate($data){
return check_for_valid_image_data($data);
}
}
$id = $untaint::check('id', $_GET['id'], $untaint::UINT);
$time = $untaint::check('time', $_POST['date'], $untaint::DATETIME);
$images[] = $untaint::check_array('images', $_FILES['images[]'], new MyImageUntainter());
if ($untaint::errors()){
foreach ($untaint::errors() as $error) {
print "Field " . $error->field . " did not validate";
print " Value: " . $error->value;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment