Make WordPress Core

Opened 3 years ago

Last modified 7 months ago

#38622 new defect (bug)

XML-RPC wp_newComment should return an error when a field exceeds the maximum length

Reported by: rachelbaker Owned by:
Milestone: Awaiting Review Priority: low
Severity: normal Version: 4.5
Component: XML-RPC Keywords: good-first-bug has-patch needs-testing
Focuses: Cc:
PR Number:


We return a WP_Error in wp_handle_comment_submission() when the comment content, author name, author email, or author url exceeds the maximum length of its respective database column. See #10377.

We should do the same in the XML-RPC wp_newComment() method.

Attachments (1)

38622.diff (857 bytes) - added by kingkero 7 months ago.

Download all attachments as: .zip

Change History (5)

#2 @desrosj
10 months ago

  • Keywords needs-patch added

#3 @desrosj
7 months ago

  • Keywords good-first-bug added
  • Priority changed from normal to low

Marking this as good first bug, but a lower priority.

7 months ago

#4 @kingkero
7 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

Added max lengths check via the wp_check_comment_data_max_lengths() function. Respect the $avoid_die flag with the same logic that wp_allow_comment() uses

Note: See TracTickets for help on using tickets.