array_map() problems
| From: | Jeffery Fernandez | Date: | Mon, 07 Feb 2005 22:37:11 +0000 |
| Subject: | array_map() problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-208209@lists.php.net to get a copy of this message | ||
I have the following 2 functions which I intend to clean GPC off slashes if magic_quotes_gpc is turned on.
function StripGpcSlashes()
{
if (get_magic_quotes_gpc())
{
$_POST = array_map('StripSlashesDeep', $_POST);
$_GET = array_map('StripSlashesDeep', $_GET);
$_COOKIE = array_map('StripSlashesDeep', $_COOKIE);
} }
function StripSlashesDeep($value)
{
$value = is_array($value)
? array_map('StripSlashesDeep', $value)
: stripslashes($value);
return $value;
}
However when I call $this->StripGpcSlashes(); from within a class, I get the following error:
*/ array_map(): The first argument, 'StripSlashesDeep', should be either NULL or a valid callback /*
Anyone have suggestions as to what I am doing wrong ?
cheers,
Jeffery