Handle more cases (untrailingslashit
, HTTPS urls) for sanitizing an author URL for display in the comments list table.
Props afercia, mehulkaklotar, swissspidy, johnbillion. Fixes #33291. git-svn-id: https://develop.svn.wordpress.org/trunk@33894 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
46af2b9cd9
commit
43c8ec5f32
@ -636,19 +636,15 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||
global $comment_status;
|
||||
|
||||
$author_url = get_comment_author_url( $comment->comment_ID );
|
||||
if ( 'http://' == $author_url ) {
|
||||
$author_url = '';
|
||||
}
|
||||
|
||||
$author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
|
||||
$author_url_display = untrailingslashit( preg_replace( '|^http(s)?://(www\.)?|i', '', $author_url ) );
|
||||
if ( strlen( $author_url_display ) > 50 ) {
|
||||
$author_url_display = wp_html_excerpt( $author_url_display, 49, '…' );
|
||||
}
|
||||
|
||||
|
||||
echo "<strong>"; comment_author( $comment->comment_ID ); echo '</strong><br />';
|
||||
if ( !empty( $author_url ) ) {
|
||||
echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
|
||||
if ( ! empty( $author_url_display ) ) {
|
||||
printf( '<a href="%s">%s</a><br />', esc_url( $author_url ), esc_html( $author_url_display ) );
|
||||
}
|
||||
|
||||
if ( $this->user_can ) {
|
||||
|
Loading…
Reference in New Issue
Block a user