[wp-trac] [WordPress Trac] #21767: Remove stripslashes from API functions

WordPress Trac noreply at wordpress.org
Tue Feb 26 22:59:32 UTC 2013


#21767: Remove stripslashes from API functions
-------------------------------------------------+-------------------------
 Reporter:  alexkingorg                          |       Owner:
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  3.6
Component:  Formatting                           |     Version:  3.4
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |
  tests 3.6-early                                |
-------------------------------------------------+-------------------------

Comment (by ryan):

 We are changing tack on this. Functions such as wp_insert_post() that
 accept argument arrays will accept a "slashed" argument. slashed will
 default to true. Plugins and core functions that wish to pass unslashed
 data will need to pass slashed => true. When slashed is true, wp_unslash()
 will be run on the passed I data. When it is false wp_unslash will not be
 run. As I am still on the road, could someone patch wp_insert_post() to
 handle the slashed argument and have all core calls to wp_insert_post()
 pass slashed => false since we'd like to maintain passing unslashed data
 in core as a new standard? Once that is in, we can roll out to other
 functions that used to be slashed and get things back compat again. The
 new wp_update_post_meta() and wp_insert_post_meta() functions can be
 removed.

 It is clear that we'll have to fork a bunch of functions to reach a slash
 less future. We'll probably take this opportunity to add methods to
 WP_Post and introduce WP_Comment. That's a discussion for 3.7, however.

 Possibly back on the table for 3.6 is moving away for the GPCS
 supergloblals.  It's looking like we my never be able to stop slashing
 GPCS, so let's consider something like WP:GET, WP:POST. Something light
 with just what we need. This can be discussed on #22325.

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


More information about the wp-trac mailing list