Skip to content

Instantly share code, notes, and snippets.

@d4rkd0s
Created September 30, 2014 01:06
Show Gist options
  • Save d4rkd0s/f3fd77d50ddfd7399fc4 to your computer and use it in GitHub Desktop.
Save d4rkd0s/f3fd77d50ddfd7399fc4 to your computer and use it in GitHub Desktop.
Magic Quotes in PHP5.4+ (How to fix GET's and POST's and get them escaped)
// This replicates magic_quotes_gpc in PHP 5.4+
foreach($_POST as $key => $val){
$_POST[$key] = addslashes($val);
}
foreach($_GET as $key => $val){
$_GET[$key] = addslashes($val);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment