Comment content can be string with zero#221
Comment content can be string with zero#221cawa-93 wants to merge 2 commits intoWordPress:masterfrom cawa-93:patch-1
Conversation
|
if ( ! isset( $prepared_comment['comment_content'] ) || $prepared_comment['comment_content'] === '' ) {Or, if if ( $prepared_comment['comment_content'] === '' ) { |
|
Yeah, I think it would be better to do an |
|
@TimothyBJacobs I agree with you. I didn't think about matching the behavior in the $allow_empty_comment = apply_filters( 'rest_allow_empty_comment', false, $prepared_comment );
$missing_content = ! isset( $prepared_comment['comment_content'] ) || '' === $prepared_comment['comment_content']
if ( $missing_content && ! $allow_empty_comment ) {
return new WP_Error(
'rest_comment_content_invalid',
__( 'Invalid comment content.' ),
array( 'status' => 400 )
);
} |
|
Yeah I think it'd be great to make sure we realign ourselves with |
|
Another related ticket: https://core.trac.wordpress.org/ticket/43177 |
|
Fixed in 1e030c4. |
Trac ticket: https://core.trac.wordpress.org/ticket/49903#ticket
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.