Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#28254 closed defect (bug) (fixed)

Comment posting doesn't handle the INSERT failing

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


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 7 years ago.

Download all attachments as: .zip

Change History (4)

7 years ago

#1 @pento
7 years ago

  • Keywords has-patch added

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

#2 @pento
7 years ago

  • Keywords commit added

#3 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to 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.