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

Ryan Boren ryan at boren.nu
Tue Jul 5 23:48:37 GMT 2005


On Wed, 2005-07-06 at 00:23 +0100, Mike Little wrote:
> On 05/07/05, Ryan Boren <ryan at boren.nu> wrote:
> > 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
> > 
> 
> Everything!
> 
> Home page equals empty feed.
> can't login
> upgrade appears to do nothing (returns to same page)
> dropped database - install appears to do nothing (returns to same page)
> 
> revert to 2698
> drop database
> install 
> all ok
> 
> update to 2699
> run upgrade (returns to same page)
> can't login
> home page is empty feed.
> 
> drop database 
> still with 2699 - install
> does nothing (returns to same page)
> no tables created.

Everything is okay here.

Maybe wpdb->escape is returning an empty string.

Ryan



More information about the wp-hackers mailing list