I'd recommend figuring out how to turn it off completely (using at least .htaccess, hopefully php.ini if you can get to it).
That'll work fine for this but anything else you add on the same host will have the same (potential) problem.
Note also that the function you are using is only minimally effective: it works on specific input data and may not work as expected in all cases.
Also, for some particularly annoying reason, the keys (in addition to the values) are escaped like this, so to fully remove it you need to do:
PHP Code:
foreach($somearray as $key=>$value) {
$newarray[undo($key)] = undo($value);
}
$somearray = $newarray;
//(pseudo code)
In reality this may rarely be an issue, but it'll be very confusing if it ever does occur.
magic quotes is something that should be banned from use, and in fact most people are trying to remove it, but it's still floating around on enough servers (as a default in php4, etc) that it's a frequent issue.
Good luck.
Bookmarks