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

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 19 23:48:35 UTC 2012


#21767: Remove stripslashes from API functions
-------------------------------------------------+-------------------------
 Reporter:  alexkingorg                          |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  General                              |  Review
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch needs-testing needs-unit-  |  Resolution:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by alexkingorg):

 In looking through the unit testing code I notice that the
 `create|update_object()` methods for comments call
 `$this->addslashes_deep()` on the content they then pass to
 `wp_insert|update_comment()`. The same steps are *not* taken for the
 `create|update_object()` methods for posts, terms, users, etc. All of
 those tests are `_doing_it_wrong()` and lose data. If the unit tests
 passed data with slashes they would fail.

 <soapbox>THIS IS WHY THIS PATCH IS IMPORTANT.</soapbox> :)

 For now I'm creating new unit tests to explicitly test slash behavior
 (wrote the first one today - w00T!) in the "model" functions
 (`wp_update|insert_*()`) and the controller functions that pull content
 directly from $_POST (`edit_post()`, etc.).

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


More information about the wp-trac mailing list