Make WordPress Core

Ticket #58831: 58831-missing-escaping.patch

File 58831-missing-escaping.patch, 1.7 KB (added by himanshuc, 3 months ago)
  • wp-admin/comment.php

     
    161161                                        break;
    162162                        }
    163163                        if ( $message ) {
    164                                 echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
     164                                echo '<div id="message" class="notice notice-info"><p>' . esc_html( $message ) . '</p></div>';
    165165                        }
    166166                }
    167167                ?>
    168 <div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
     168<div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo esc_html( $caution_msg ); ?></p></div>
    169169
    170170<table class="form-table comment-ays">
    171171<tr>
     
    195195                } else {
    196196                        $post_link = esc_html( get_the_title( $post_id ) );
    197197                }
    198                 echo $post_link;
     198                echo esc_attr( $post_link );
    199199
    200200                if ( $comment->comment_parent ) {
    201201                        $parent      = get_comment( $comment->comment_parent );
     
    204204                        printf(
    205205                                /* translators: %s: Comment link. */
    206206                                ' | ' . __( 'In reply to %s.' ),
    207                                 '<a href="' . $parent_link . '">' . $name . '</a>'
     207                                '<a href="' . esc_url( $parent_link ) . '">' . esc_html( $name ) . '</a>'
    208208                        );
    209209                }
    210210                ?>
     
    223223                        get_comment_date( __( 'g:i a' ), $comment )
    224224                );
    225225                if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
    226                         echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
     226                        echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . esc_html( $submitted ) . '</a>';
    227227                } else {
    228                         echo $submitted;
     228                        echo esc_attr( $submitted );
    229229                }
    230230                ?>
    231231        </td>