Skip to content

Instantly share code, notes, and snippets.

@jlogsdon
Created August 17, 2009 15:32
Show Gist options
  • Save jlogsdon/169178 to your computer and use it in GitHub Desktop.
Save jlogsdon/169178 to your computer and use it in GitHub Desktop.
<?php
// Magic quotes will end us all, so remove any quotes added by it
if (get_magic_quotes_gpc()) {
function _rss($v) {
$f = __FUNCTION__;
if (is_array($v)) {
foreach ($v as $k => $j) {
$v[$k] = $f($j); // yay recurssion!
}
return $v;
} else {
return stripslashes($v);
}
}
foreach ($_GET as $k => $v) {
$_GET[$k] = _rss($v);
}
foreach ($_POST as $k => $v) {
$_POST[$k] = _rss($v);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment