Since problems with null bytes do not stretch to regular string functions, this should be enough to ensure no GET parameter contains them any more:
<?php
function getVar($name)
{
$value = isset($_GET[$name]) ? $_GET[$name] : null;
if (is_string($value)) {
$value = str_replace("\0", '', $value);
}
}
?>
Modifying this to work with other superglobals should not be a problem, so I will leave it up to you.