[wp-trac] [WordPress Trac] #9189: add_magic_quotes now double-escaping post content when saving

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 20 16:22:52 GMT 2009


#9189: add_magic_quotes now double-escaping post content when saving
-----------------------------+----------------------------------------------
 Reporter:  filosofo         |       Owner:  anonymous                                
     Type:  defect (bug)     |      Status:  new                                      
 Priority:  highest omg bbq  |   Milestone:  2.8                                      
Component:  General          |     Version:                                           
 Severity:  normal           |    Keywords:  add_magic_quotes mysql_real_escape_string
-----------------------------+----------------------------------------------
 [10597] introduced the use of mysql_real_escape_string() in wpdb's
 escape() method.

 However, when you save a post the content gets double-escaped, which means
 that line breaks are turned into {{{\r\n}}} and then {{{\\r\\n}}}.

 The first escape is in wp-settings.php where applies add_magic_quotes() to
 $_POST.

 The second is in wp_update_post() which applies it to the post content
 (wp_update_post() is called by edit_post()).

 Then wp_update_post() calls wp_insert_post(), which calls
 stripslashes_deep(), so we end up with {{{rn}}}.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9189>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list