WordPress.org

Make WordPress Core

Ticket #10377: 10377.2.patch

File 10377.2.patch, 1.9 KB (added by rachelbaker, 5 years ago)

Refreshed patch

  • src/wp-comments-post.php

     
    130130        wp_die( __( '<strong>ERROR</strong>: please type a comment.' ), 200 );
    131131}
    132132
     133if ( 65535 < strlen( $comment_content ) ) {
     134        wp_die( __( '<strong>ERROR</strong>: your comment is too large.' ), 200 );
     135}
     136
    133137$comment_parent = isset($_POST['comment_parent']) ? absint($_POST['comment_parent']) : 0;
    134138
    135139$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'comment_parent', 'user_ID');
  • src/wp-includes/comment-template.php

     
    22502250        $fields = apply_filters( 'comment_form_default_fields', $fields );
    22512251        $defaults = array(
    22522252                'fields'               => $fields,
    2253                 'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true" required="required"></textarea></p>',
     2253                'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65535" aria-required="true" required="required"></textarea></p>',
    22542254                /** This filter is documented in wp-includes/link-template.php */
    22552255                'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
    22562256                /** This filter is documented in wp-includes/link-template.php */