- Timestamp:
- 11/03/2016 01:11:30 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r39089 r39101 485 485 } 486 486 487 $check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_comment ); 488 if ( is_wp_error( $check_comment_lengths ) ) { 489 $error_code = $check_comment_lengths->get_error_code(); 490 return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) ); 491 } 492 487 493 $prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true ); 488 494 … … 631 637 632 638 $prepared_args['comment_ID'] = $id; 639 640 $check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_args ); 641 if ( is_wp_error( $check_comment_lengths ) ) { 642 $error_code = $check_comment_lengths->get_error_code(); 643 return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) ); 644 } 633 645 634 646 $updated = wp_update_comment( $prepared_args );
Note: See TracChangeset
for help on using the changeset viewer.