Make WordPress Core


Ignore:
Timestamp:
08/31/2015 08:40:28 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Use wp_html_excerpt() to properly cut comment author URL for display on Comments screen.

props brettz95, solarissmoke.
fixes #15659.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r33662 r33825  
    633633
    634634                $author_url = get_comment_author_url();
    635                 if ( 'http://' == $author_url )
     635                if ( 'http://' == $author_url ) {
    636636                        $author_url = '';
     637                }
     638
    637639                $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
    638                 if ( strlen( $author_url_display ) > 50 )
    639                         $author_url_display = substr( $author_url_display, 0, 49 ) . '…';
     640                if ( strlen( $author_url_display ) > 50 ) {
     641                        $author_url_display = wp_html_excerpt( $author_url_display, 49, '…' );
     642                }
     643
    640644
    641645                echo "<strong>"; comment_author(); echo '</strong><br />';
    642                 if ( !empty( $author_url ) )
     646                if ( !empty( $author_url ) ) {
    643647                        echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
     648                }
    644649
    645650                if ( $this->user_can ) {
Note: See TracChangeset for help on using the changeset viewer.