Hi,
I'm running this function to sanitize all user input through out my site, but it worries me that it may be very performance intensive...
// function for cleaning arrays, recursively for arrays held inside arrays
function array_clean($array)
{
// if its an array, walk each element recursively
if(is_array($array))
{
return array_map("escape", $array);
}
// until its a single element, then clean the single element
else
{
return escape($array);
}
}
// Recursively walk our global variables
$_POST= array_map("array_clean", $_POST);
$_GET= array_map("array_clean", $_GET);
$_REQUEST= array_map("array_clean", $_REQUEST);
$GLOBALS= array_map("array_clean", $GLOBALS);
$_SERVER= array_map("array_clean", $_SERVER);
$_FILES= array_map("array_clean", $_FILES);
$_COOKIE= array_map("array_clean", $_COOKIE);
$_SESSION= array_map("array_clean", $_SESSION);
$_ENV=array_map("array_clean", $_ENV);
I need your insight.. Thanks