$HTTP_COOKIE_VARS = array_map('htmlspecialchars', $HTTP_COOKIE_VARS);
$_SERVER = array_map('htmlspecialchars', $_SERVER);

これでおk?