From 8b1fe986c333410c452e557553f4db88df12064a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 31 Aug 2015 20:41:21 +0000 Subject: [PATCH] Use `wp_html_excerpt()` to properly cut comment author URL for display on Comments screen. props brettz95, solarissmoke. fixes #15659. Built from https://develop.svn.wordpress.org/trunk@33825 git-svn-id: http://core.svn.wordpress.org/trunk@33793 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-comments-list-table.php | 13 +++++++++---- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index 7104486c85..49ecaa5cf8 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -632,15 +632,20 @@ class WP_Comments_List_Table extends WP_List_Table { global $comment_status; $author_url = get_comment_author_url(); - if ( 'http://' == $author_url ) + if ( 'http://' == $author_url ) { $author_url = ''; + } + $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url ); - if ( strlen( $author_url_display ) > 50 ) - $author_url_display = substr( $author_url_display, 0, 49 ) . '…'; + if ( strlen( $author_url_display ) > 50 ) { + $author_url_display = wp_html_excerpt( $author_url_display, 49, '…' ); + } + echo ""; comment_author(); echo '
'; - if ( !empty( $author_url ) ) + if ( !empty( $author_url ) ) { echo "$author_url_display
"; + } if ( $this->user_can ) { if ( !empty( $comment->comment_author_email ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 427e88a088..1a5ecbd624 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33824'; +$wp_version = '4.4-alpha-33825'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.