[wp-trac] [WordPress Trac] #39380: wp_update_comment strips data from passed array

WordPress Trac noreply at wordpress.org
Fri Dec 23 12:06:43 UTC 2016


#39380: wp_update_comment strips data from passed array
--------------------------+-----------------------------
 Reporter:  dshanske      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  4.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In 4.6, the comment data array was passed into the edit_comment action. In
 4.7, the wp_update_comment_data filter was added to wp_update_comment.

 However, wp_array_slice_assoc is called to filter keys out of the array
 before it is passed to both.

 It should be called only to filter the data going into the database. By
 adding a key to the array at the filter, for example, you can cause a
 database error.

 By removing extra keys from the data before it hits edit_comment, it makes
 it impossible to pass data to be saved as metadata.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39380>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list