Ticket #43177: 43177.2.patch
File 43177.2.patch, 2.5 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
1146 1146 wp_die( __( 'Sorry, you must be logged in to reply to a comment.' ) ); 1147 1147 } 1148 1148 1149 if ( '' == $comment_content) {1149 if ( '' === trim( $comment_content ) ) { 1150 1150 wp_die( __( 'ERROR: please type a comment.' ) ); 1151 1151 } 1152 1152 -
src/wp-includes/class-wp-xmlrpc-server.php
3719 3719 3720 3720 if ( isset( $content_struct['content'] ) ) { 3721 3721 $comment_content = $content_struct['content']; 3722 3723 if ( '' === trim( $comment_content ) ) { 3724 return new IXR_Error( 403, __( 'Invalid comment content.' ) ); 3725 } 3722 3726 } 3723 3727 3724 3728 if ( isset( $content_struct['author'] ) ) { … … 3823 3827 return new IXR_Error( 403, __( 'Sorry, comments are closed for this item.' ) ); 3824 3828 } 3825 3829 3826 if ( empty( $content_struct['content'] ) ) {3830 if ( empty( $content_struct['content'] ) || '' === trim( $content_struct['content'] ) ) { 3827 3831 return new IXR_Error( 403, __( 'Comment is required.' ) ); 3828 3832 } 3829 3833 -
src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
504 504 * Do not allow a comment to be created with missing or empty 505 505 * comment_content. See wp_handle_comment_submission(). 506 506 */ 507 if ( empty( $prepared_comment['comment_content'] ) ) {507 if ( empty( $prepared_comment['comment_content'] ) || '' === trim( $prepared_comment['comment_content'] ) ) { 508 508 return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); 509 509 } 510 510 … … 707 707 return $prepared_args; 708 708 } 709 709 710 if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) {710 if ( isset( $prepared_args['comment_content'] ) && '' === trim( $prepared_args['comment_content'] ) ) { 711 711 return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); 712 712 } 713 713