WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 months ago

#38622 reopened 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 has-unit-tests
Focuses: Cc:

Description

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 13 months ago.

Download all attachments as: .zip

Change History (11)

#2 @desrosj
15 months ago

  • Keywords needs-patch added

#3 @desrosj
13 months ago

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

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

@kingkero
13 months ago

#4 @kingkero
13 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

This ticket was mentioned in PR #178 on WordPress/wordpress-develop by sorenbronsted.


4 months ago

<!--
Hi there! Thanks for contributing to WordPress!

Pull Requests in this GitHub repository must be linked to a ticket in the WordPress Core Trac instance (https://core.trac.wordpress.org), and are only used for code review. No pull requests will be merged on GitHub.

See the WordPress Handbook page on using PRs for Code Review more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/

If this is your first time contributing, you may also find reviewing these guides first to be helpful:

-->

I have applied the patch from this ticket and fixed at bug when posting a comment via xmlrpc. Anon posting was missing the content_type which resulted in an error.

Trac ticket: https://core.trac.wordpress.org/ticket/38622

This ticket was mentioned in PR #179 on WordPress/wordpress-develop by sorenbronsted.


4 months ago

<!--
Hi there! Thanks for contributing to WordPress!

Pull Requests in this GitHub repository must be linked to a ticket in the WordPress Core Trac instance (https://core.trac.wordpress.org), and are only used for code review. No pull requests will be merged on GitHub.

See the WordPress Handbook page on using PRs for Code Review more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/

If this is your first time contributing, you may also find reviewing these guides first to be helpful:

-->

I have applied the patch from this ticket and fixed at bug when posting a comment via xmlrpc. Anon posting was missing the content_type which resulted in an error. Fixed phpcs issues also.

Trac ticket: https://core.trac.wordpress.org/ticket/38622

This ticket was mentioned in PR #180 on WordPress/wordpress-develop by sorenbronsted.


4 months ago

<!--
Hi there! Thanks for contributing to WordPress!

Pull Requests in this GitHub repository must be linked to a ticket in the WordPress Core Trac instance (https://core.trac.wordpress.org), and are only used for code review. No pull requests will be merged on GitHub.

See the WordPress Handbook page on using PRs for Code Review more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/

If this is your first time contributing, you may also find reviewing these guides first to be helpful:

-->

I have applied the patch from this ticket and fixed at bug when posting a comment via xmlrpc. Anon posting was missing the content_type which resulted in an error. Fixed phpcs issues also.

Trac ticket: https://core.trac.wordpress.org/ticket/38622

#8 @sorenbronsted
4 months ago

  • Keywords has-unit-tests added
  • Resolution set to invalid
  • Status changed from new to closed

Sorry that my PR messed up the this comment section. PR #180 state says 'undefined' but on https://github.com/WordPress/wordpress-develop/pull/180 it says 'all checks has passed' so the state on this ticket is not reflected correctly.

#9 @sorenbronsted
3 months ago

  • Keywords needs-testing removed
  • Resolution invalid deleted
  • Status changed from closed to reopened

I incorrectly set wrong keywords

This ticket was mentioned in PR #194 on WordPress/wordpress-develop by sorenbronsted.


3 months ago

Note: See TracTickets for help on using tickets.