- Timestamp:
- 11/10/2016 03:34:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r39179 r39196 432 432 433 433 /* 434 * Do not allow a comment to be created with an empty string for434 * Do not allow a comment to be created with missing or empty 435 435 * comment_content. See wp_handle_comment_submission(). 436 436 */ 437 if ( '' === $prepared_comment['comment_content']) {437 if ( empty( $prepared_comment['comment_content'] ) ) { 438 438 return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) ); 439 439 } … … 635 635 if ( is_wp_error( $prepared_args ) ) { 636 636 return $prepared_args; 637 } 638 639 if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) { 640 return new WP_Error( 'rest_comment_content_invalid', __( 'Comment content is invalid.' ), array( 'status' => 400 ) ); 637 641 } 638 642 … … 1063 1067 list( $prepared_comment['comment_date'], $prepared_comment['comment_date_gmt'] ) = $date_data; 1064 1068 } 1065 }1066 1067 // Require 'comment_content' unless only the 'comment_status' is being updated.1068 if ( ! empty( $prepared_comment ) && ! isset( $prepared_comment['comment_content'] ) ) {1069 return new WP_Error( 'rest_comment_content_required', __( 'Missing comment content.' ), array( 'status' => 400 ) );1070 1069 } 1071 1070
Note: See TracChangeset
for help on using the changeset viewer.