WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#38466 closed defect (bug) (fixed)

Check if comment content is passed in XML-RPC

Reported by: markoheijnen Owned by: johnbillion
Milestone: 4.7 Priority: normal
Severity: normal Version: 2.7
Component: XML-RPC Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Currently empty comments are allowed because wp_handle_comment_submission() isn't used when creating a new comment. Looking at the REST API, it also doesn't use it but still check if the comment isn't empty. Let's apply the same behavior for XML-RPC.

Depends on #14452 for not using wp_die() in wp_new_comment()

Attachments (1)

38466.diff (2.3 KB) - added by markoheijnen 3 years ago.

Download all attachments as: .zip

Change History (4)

@markoheijnen
3 years ago

#1 @markoheijnen
3 years ago

  • Keywords has-patch added

#2 @johnbillion
3 years ago

  • Keywords has-unit-tests added
  • Milestone changed from Awaiting Review to 4.7
  • Owner set to johnbillion
  • Status changed from new to reviewing
  • Type changed from enhancement to defect (bug)

#3 @johnbillion
3 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 39045:

XML-RPC: Correctly handle empty and duplicate comments.

This prevents wp_die() being sent in response to an XML-RPC call that attempts to submit a duplicate comment, and correctly returns an error in response to an attempt to submit an empty comment.

Props markoheijnen, websupporter.
Fixes #14452, #38466.
See #36901

Note: See TracTickets for help on using tickets.