Make WordPress Core

Changeset 2699 for trunk/wp-settings.php


Ignore:
Timestamp:
07/05/2005 08:47:22 PM (21 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-settings.php

    r2632 r2699  
    137137require_once(ABSPATH . WPINC . '/locale.php');
    138138
    139 if ( !get_magic_quotes_gpc() ) {
    140         $_GET    = add_magic_quotes($_GET   );
    141         $_POST   = add_magic_quotes($_POST  );
    142         $_COOKIE = add_magic_quotes($_COOKIE);
    143         $_SERVER = add_magic_quotes($_SERVER);
     139// If already slashed, strip.
     140if ( get_magic_quotes_gpc() ) {
     141        $_GET    = stripslashes($_GET   );
     142        $_POST   = stripslashes($_POST  );
     143        $_COOKIE = stripslashes($_COOKIE);
     144        $_SERVER = stripslashes($_SERVER);
    144145}
     146
     147// Escape with wpdb.
     148$_GET    = add_magic_quotes($_GET   );
     149$_POST   = add_magic_quotes($_POST  );
     150$_COOKIE = add_magic_quotes($_COOKIE);
     151$_SERVER = add_magic_quotes($_SERVER);
    145152
    146153function shutdown_action_hook() {
Note: See TracChangeset for help on using the changeset viewer.