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

Denis de Bernardy denis at semiologic.com
Tue Jul 5 21:29:26 GMT 2005


Err... if(!$this->dbh) die('sorry, no db...');

D.

> -----Original Message-----
> From: wp-hackers-bounces at lists.automattic.com 
> [mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of 
> Ryan Boren
> Sent: Tuesday, July 05, 2005 11:07 PM
> To: wp-hackers at lists.automattic.com
> Subject: [wp-hackers] s/addslashes/$wpdb->escape/
> 
> 
> 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
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com 
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 



More information about the wp-hackers mailing list