Make WordPress Core


Ignore:
Timestamp:
11/29/2015 02:40:42 AM (10 years ago)
Author:
johnbillion
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r35723 r35748  
    185185    $display = ($linktext != '') ? $linktext : $email;
    186186        $return  = $before;
    187         $return .= "<a href='mailto:$email'>$display</a>";
     187        $return .= sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'mailto:' . $email ), esc_html( $display ) );
    188188        $return .= $after;
    189189        return $return;
     
    279279 */
    280280function comment_author_IP( $comment_ID = 0 ) {
    281     echo get_comment_author_IP( $comment_ID );
     281    echo esc_html( get_comment_author_IP( $comment_ID ) );
    282282}
    283283
Note: See TracChangeset for help on using the changeset viewer.