Use wpdb->escape instead of addslashes to prepare DB bound data.

git-svn-id: https://develop.svn.wordpress.org/trunk@2699 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-07-05 20:47:22 +00:00
parent bcb1e84446
commit b3f7bd726c
19 changed files with 101 additions and 89 deletions
+12 -5
View File
@@ -136,13 +136,20 @@ load_default_textdomain();
// Pull in locale data after loading text domain.
require_once(ABSPATH . WPINC . '/locale.php');
if ( !get_magic_quotes_gpc() ) {
$_GET = add_magic_quotes($_GET );
$_POST = add_magic_quotes($_POST );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);
// If already slashed, strip.
if ( get_magic_quotes_gpc() ) {
$_GET = stripslashes($_GET );
$_POST = stripslashes($_POST );
$_COOKIE = stripslashes($_COOKIE);
$_SERVER = stripslashes($_SERVER);
}
// Escape with wpdb.
$_GET = add_magic_quotes($_GET );
$_POST = add_magic_quotes($_POST );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);
function shutdown_action_hook() {
do_action('shutdown');
}