Make WordPress Core

Ticket #47975: 47975.diff

File 47975.diff, 977 bytes (added by dinhtungdu, 7 years ago)
  • src/wp-includes/comment-template.php

     
    24392439                                $comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields'];
    24402440
    24412441                                /**
     2442                                 * Check for the appearance of valid and non empty #email-notes
     2443                                 * in the comment_notes_before to remove aria-describedby in the
     2444                                 * email field.
     2445                                 *
     2446                                 * @since 5.3.0
     2447                                 */
     2448                                $regex = '/<([\w\d]+)\b([^id\>]+)(id="email-notes")([^>]+)?>(\s+)?(?=[\d\w]+)[^\<\>]+<\/\1>/m';
     2449                                if( 0 === preg_match( $regex, $args['comment_notes_before'] ) ) {
     2450                                        $comment_fields['email'] = str_replace(
     2451                                                ' aria-describedby="email-notes"',
     2452                                                '',
     2453                                                $comment_fields['email']
     2454                                        );
     2455                                }
     2456
     2457                                /**
    24422458                                 * Filters the comment form fields, including the textarea.
    24432459                                 *
    24442460                                 * @since 4.4.0