3 ms·
How the hell does this get upvoted to the #2 spot on hacker news? This is both dumb and not news. Ranting on magic_quotes_gpc has been done to death already.
by wvenable 18y ago
How the hell does this get upvoted to the #2 spot on hacker news?
This is both dumb and not news. Ranting on magic_quotes_gpc has been done to death already.
Now for some code:
if (get_magic_quotes_gpc()) {
array_stripslashes($_GET);
array_stripslashes($_POST);
array_stripslashes($_REQUEST);
array_stripslashes($_COOKIE);
}
function array_stripslashes(array &$array)
{
foreach ($array as $key => &$value) {
if (is_string($value)) $value = stripslashes($value);
elseif (is_array($value)) array_stripslashes($value);
}
}