mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
In a similar vein to [34133], escape the email address and IP address of comment authors to increase defence in depth.
Built from https://develop.svn.wordpress.org/trunk@35748 git-svn-id: http://core.svn.wordpress.org/trunk@35712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6f37afb6ec
commit
ec24d6e001
@ -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( '<a href=\'mailto:%1$s\'>%1$s</a><br />', $email );
|
||||
printf( '<a href="%1$s">%2$s</a><br />', 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( '<a href="%s">%s</a>', esc_url( $author_ip_url ), $author_ip );
|
||||
printf( '<a href="%1$s">%2$s</a>', esc_url( $author_ip_url ), esc_html( $author_ip ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ function get_comment_author_email_link( $linktext = '', $before = '', $after = '
|
||||
if ((!empty($email)) && ($email != '@')) {
|
||||
$display = ($linktext != '') ? $linktext : $email;
|
||||
$return = $before;
|
||||
$return .= "<a href='mailto:$email'>$display</a>";
|
||||
$return .= sprintf( '<a href="%1$s">%2$s</a>', 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 ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-RC1-35747';
|
||||
$wp_version = '4.4-RC1-35748';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user