Stripslashes if magic quotes enabled
Posted: Tue Oct 27, 2009 10:52 pm
I recall having a snippet of code in my application that checked for magic quotes and stripped quotes if nessecary using a recurvsive method. I searched google breifly and php.net and found this snippet:
I wrap this in a simple if() to test whether magic quotes are on or not and voila!!!
Can anyone see any enhancements or issues with this approach...
Cheers,
Alex
Code: Select all
function stripslashes_deep($value)
{
$value = is_array($value) ?
array_map('stripslashes_deep', $value) :
stripslashes($value);
return $value;
}Can anyone see any enhancements or issues with this approach...
Cheers,
Alex