[wp-trac] [WordPress Trac] #12942: Change str_replace to preg_replace for $wpdb->prepare function

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 9 17:13:42 UTC 2010


#12942: Change str_replace to preg_replace for $wpdb->prepare function
-------------------------+--------------------------------------------------
 Reporter:  gplaurin     |       Owner:                            
     Type:  enhancement  |      Status:  new                       
 Priority:  normal       |   Milestone:  Unassigned                
Component:  General      |     Version:  2.9.2                     
 Severity:  normal       |    Keywords:  database, prepare, sprintf
-------------------------+--------------------------------------------------

Comment(by nacin):

 $wpdb->prepare adds quotes for you when you use %s. You would just do
 user.email = %s, not user.email = '%s'. Hence the preparation.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12942#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list