[wp-trac] [WordPress Trac] #39380: wp_update_comment can cause database error with new filter

WordPress Trac noreply at wordpress.org
Tue Dec 27 17:21:06 UTC 2016


#39380: wp_update_comment can cause database error with new filter
------------------------------+--------------------------
 Reporter:  dshanske          |       Owner:  rachelbaker
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.7.1
Component:  Comments          |     Version:  4.6
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+--------------------------
Changes (by rachelbaker):

 * owner:   => rachelbaker
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"39640"]:
 {{{
 #!CommitTicketReference repository="" revision="39640"
 Comments: Fix placement of the `wp_update_comment_data` filter to
 safeguard filtered data from triggering a database error.

 Introduced in [38674], the `wp_update_comment_data` filter took place
 after the `$data` was sliced and prepared for the database update
 statement. The location of the filter assumed the result of anyone
 applying it would not change the data type or make structural
 modifications or additions to the $data array. 😅

 This moves the `wp_update_comment_data` filter to take place before the
 `$data` is sliced and prepared for the database update statement.

 Props dshanske for initial patch.

 Fixes #39380.
 }}}

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


More information about the wp-trac mailing list