Make WordPress Core

Ticket #40916: 40916.2.2.diff

File 40916.2.2.diff, 836 bytes (added by audrasjb, 3 years ago)

Comments: In the admin, open comment author links in a new tab, and add a noopener rel attribute.

  • src/wp-admin/includes/class-wp-comments-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php
    index 2fbbbc3328..530d1fc410 100644
    a b class WP_Comments_List_Table extends WP_List_Table { 
    947947                echo '</strong><br />';
    948948
    949949                if ( ! empty( $author_url_display ) ) {
    950                         printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
     950                        printf(
     951                                '<a href="%s" target="_blank" rel="noopener">%s <span class="screen-reader-text">%s</span></a><br />',
     952                                esc_url( $author_url ),
     953                                esc_html( $author_url_display ),
     954                                /* translators: Accessibility text. */
     955                                __( '(opens in a new tab)' )
     956                        );
    951957                }
    952958
    953959                if ( $this->user_can ) {