-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments controller: fix issue where comments are allowed when closed #66976
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @xavier-lc. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally via curl and it returns the proper response:
{"body":{"code":"rest_comment_closed","message":"Sorry, comments are closed for this item.","data":{"status":403}},"status":403,"headers":{"Allow":"GET"}}
Flaky tests detected in 904a28e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11822624735
|
I just cherry-picked this PR to the release/19.6 branch to get it included in the next release: af38d43 |
…#66976) Unlinked contributors: xavier-lc. Co-authored-by: ellatrix <[email protected]> Co-authored-by: Mamaduka <[email protected]>
…#66976) Unlinked contributors: xavier-lc. Co-authored-by: ellatrix <[email protected]> Co-authored-by: Mamaduka <[email protected]>
I just cherry-picked this PR to the release/19.7 branch to get it included in the next release: 14c270e |
What?
The comments endpoint allows no type to be specified, in which case
comment
should be assumed.https://github.com/WordPress/wordpress-develop/blob/a27e6a8ecd5279a45e47ef88d048643740d07b5a/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php#L591
Why?
Comments can be submitted even if comments are closed.
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast