Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#28254 closed defect (bug) (fixed)

Comment posting doesn't handle the INSERT failing

Reported by: pento Owned by: SergeyBiryukov
Priority: normal Milestone: 4.0
Component: Comments Version: 1.5
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

When adding a comment, it's possible for the $wpdb->insert() call in wp_insert_comment() to fail. This isn't checked, and the rest of the process assumes the comment was successfully inserted.

Attachments (1)

28254.diff​ (2.0 KB ) - added by pento 13 years ago.

Download all attachments as: .zip

Change History (4)

#1 @pento
13 years ago

  • Keywords has-patch added

attachment:28254.diff​ checks the return value, and dies if the comment wasn't inserted.

#2 @pento
12 years ago

  • Keywords commit added

#3 @SergeyBiryukov
12 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 28672:

wp_insert_comment() and wp_new_comment() should check if the comment was successfully inserted into the database.

props pento.
fixes #28254.

Note: See TracTickets for help on using tickets.