Ich habe dieses kleine Skript gebastelt, was die $_POST und $_GET Variablen absichert, das heißt alle “<" bzw. ">” durch “<” bzw. “>” ersetzt und mit der PHP-Funktion addslashes alle ” und ‘ terminiert.
$_POST = array_map('terminateAll', $_POST);
$_GET = array_map('terminateAll', $_GET);
function terminateAll($v)
{
//< und >
$v = str_replace('<', '<', $v);
$v = str_replace('>', '>', $v);
if(!get_magic_quotes_gpc()) $v = addslashes($v);
return $v;
}
$_GET = array_map('terminateAll', $_GET);
function terminateAll($v)
{
//< und >
$v = str_replace('<', '<', $v);
$v = str_replace('>', '>', $v);
if(!get_magic_quotes_gpc()) $v = addslashes($v);
return $v;
}