mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@33894 git-svn-id: http://core.svn.wordpress.org/trunk@33863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
54c2cabf66
commit
80a20e5c3d
@ -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 ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-33893';
|
||||
$wp_version = '4.4-alpha-33894';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user