In a similar vein to [34133], escape the email address and IP address of comment authors to increase defence in depth.

git-svn-id: https://develop.svn.wordpress.org/trunk@35748 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2015-11-29 02:40:42 +00:00
parent da2acf666a
commit 6565b3e423
2 changed files with 4 additions and 4 deletions

View File

@@ -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 ) );
}
/**