[wp-trac] [WordPress Trac] #11442: Untrashed comments could be deleted by wp_scheduled_delete()

WordPress Trac wp-trac at lists.automattic.com
Tue Dec 15 07:48:04 UTC 2009


#11442: Untrashed comments could be deleted by wp_scheduled_delete()
--------------------------+-------------------------------------------------
 Reporter:  nacin         |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  2.9
Component:  Trash         |     Version:  2.9
 Severity:  blocker       |    Keywords:     
--------------------------+-------------------------------------------------
 If you trash a comment, then change its comment status (say to approved)
 without running wp_untrash_comment(), the _wp_trash_meta_time comment meta
 will still exist.

 wp_scheduled_delete() will then delete the comment once the comment meta
 time is old enough.

 This isn't as much of an edge case, nor does it require a direct DB edit
 or for a plugin to get involved. The comment.php AYS form (when clicking a
 link in wp_notify_moderator() email) doesn't check what the comment's
 current status is. Thus, if the comment was already trashed, and it is
 then approved, wp_untrash_comment() will not be run and the comment meta
 will still exist.

 First solution, prevent the blocker:

 Have wp_scheduled_delete() also check whether the comment is currently in
 trash.

 Second solution, prevent the whole situation from occurring, which would
 be good for 3.0:

 Implement #11441: Comment moderation AYS should provide feedback on
 comment's current status. I hinted to this blocker in that ticket without
 realizing it was a blocker:
 {{{
 (For example, a trashed comment would need to first be untrashed before
 being approved. This doesn't happen now, which means meta is not cleaned
 up, etc.)
 }}}

 Working on a quick patch for wp_scheduled_delete() now.

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


More information about the wp-trac mailing list