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 8a70a1f5de..a7c6d869cf 100644
--- a/src/wp-admin/includes/class-wp-comments-list-table.php
+++ b/src/wp-admin/includes/class-wp-comments-list-table.php
@@ -695,7 +695,7 @@ class WP_Comments_List_Table extends WP_List_Table {
$email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
if ( ! empty( $email ) && '@' !== $email ) {
- printf( '%1$s
', $email );
+ printf( '%2$s
', esc_url( 'mailto:' . $email ), esc_html( $email ) );
}
}
@@ -705,7 +705,7 @@ class WP_Comments_List_Table extends WP_List_Table {
if ( 'spam' === $comment_status ) {
$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );
}
- printf( '%s', esc_url( $author_ip_url ), $author_ip );
+ printf( '%2$s', esc_url( $author_ip_url ), esc_html( $author_ip ) );
}
}
}
diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index 6491b7b32a..ada53c8997 100644
--- a/src/wp-includes/comment-template.php
+++ b/src/wp-includes/comment-template.php
@@ -184,7 +184,7 @@ function get_comment_author_email_link( $linktext = '', $before = '', $after = '
if ((!empty($email)) && ($email != '@')) {
$display = ($linktext != '') ? $linktext : $email;
$return = $before;
- $return .= "$display";
+ $return .= sprintf( '%2$s', esc_url( 'mailto:' . $email ), esc_html( $display ) );
$return .= $after;
return $return;
} else {
@@ -278,7 +278,7 @@ function get_comment_author_IP( $comment_ID = 0 ) {
* Default current comment.
*/
function comment_author_IP( $comment_ID = 0 ) {
- echo get_comment_author_IP( $comment_ID );
+ echo esc_html( get_comment_author_IP( $comment_ID ) );
}
/**