[wp-hackers] s/addslashes/$wpdb->escape/

Ryan Boren ryan at boren.nu
Tue Jul 5 21:06:58 GMT 2005


http://trac.wordpress.org/changeset/2699

Changing over to $wpdb->escape() instead of addslashes() to prepare data
for the DB.  $wpdb->escape() now looks like this:

function escape($string) {
  if( !$this->dbh || version_compare( phpversion(), '4.3.0' ) == '-1' )
    return mysql_escape_string( $string );
  else
    return mysql_real_escape_string( $string, $this->dbh );
}

Holler if something breaks.

Ryan



More information about the wp-hackers mailing list