Skip to content

Instantly share code, notes, and snippets.

@johnsardine
Last active January 1, 2016 00:29
Show Gist options
  • Save johnsardine/8067246 to your computer and use it in GitHub Desktop.
Save johnsardine/8067246 to your computer and use it in GitHub Desktop.
<?php
// Disable magic quotes
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment