Antidote for magic_quotes_gpc()?
I've seen dozens of PHP snippets that go like this: function DB_Quote($string) { if (get_magic_quotes_gpc() == true) { $string = stripslashes($string); } return mysql_real_escape_string($string); } What happens if I call DB_Quote("the (\\) character is cool"); ? (Thanks jspcal!) Aren't we supposed to strip slashes only when get_magic_quotes_gpc() == true and the value originated from $_GET , $_POST or $_COOKIE superglobals? Yeah, I've seen dozens of PHP snippets like that, too. It's a bit sad. Magic quotes are an input issue. It has to be fixed at the input stage, by iterating the GET/POST