From 6e6e9f77b03ac56bcf9b6e567dc70cfbbb29e653 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 22 Dec 2009 17:00:54 +0000 Subject: [PATCH] Add escaping to _wp_comment_row(). Props Denis-de-Bernardy. fixes #11492 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@12493 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/template.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 79bc99008d..39f703a252 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2114,6 +2114,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); + $comment_url = esc_url(get_comment_link($comment->comment_ID)); $approve_url = esc_url( "comment.php?action=approvecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" ); $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$post->ID&c=$comment->comment_ID&$approve_nonce" ); $spam_url = esc_url( "comment.php?action=spamcomment&p=$post->ID&c=$comment->comment_ID&$del_nonce" ); @@ -2145,7 +2146,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, case 'comment': echo ""; echo '
'; - printf(__('Submitted on %2$s at %3$s'), get_comment_link($comment->comment_ID), get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia'))); + printf(__('Submitted on %2$s at %3$s'), $comment_url, get_comment_date(__('Y/m/d')), get_comment_date(__('g:ia'))); echo '
'; comment_text(); if ( $user_can ) { ?> @@ -2172,16 +2173,16 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, if ( $comment_status && 'all' != $comment_status ) { // not looking at all comments if ( 'approved' == $the_comment_status ) - $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; else if ( 'unapproved' == $the_comment_status ) - $actions['approve'] = "" . __( 'Approve' ) . ''; + $actions['approve'] = "" . __( 'Approve' ) . ''; } else { - $actions['approve'] = "" . __( 'Approve' ) . ''; - $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; + $actions['approve'] = "" . __( 'Approve' ) . ''; + $actions['unapprove'] = "" . __( 'Unapprove' ) . ''; } if ( 'spam' != $the_comment_status && 'trash' != $the_comment_status ) { - $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; + $actions['spam'] = "" . /* translators: mark as spam link */ _x( 'Spam', 'verb' ) . ''; } elseif ( 'spam' == $the_comment_status ) { $actions['unspam'] = "" . __( 'Not Spam' ) . ''; } elseif ( 'trash' == $the_comment_status ) { @@ -2191,14 +2192,14 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, if ( 'spam' == $the_comment_status || 'trash' == $the_comment_status || !EMPTY_TRASH_DAYS ) { $actions['delete'] = "" . __('Delete Permanently') . ''; } else { - $actions['trash'] = "" . _x('Trash', 'verb') . ''; + $actions['trash'] = "" . _x('Trash', 'verb') . ''; } if ( 'trash' != $the_comment_status ) { - $actions['edit'] = "". __('Edit') . ''; - $actions['quickedit'] = '' . __('Quick Edit') . ''; + $actions['edit'] = "". __('Edit') . ''; + $actions['quickedit'] = '' . __('Quick Edit') . ''; if ( 'spam' != $the_comment_status ) - $actions['reply'] = '' . __('Reply') . ''; + $actions['reply'] = '' . __('Reply') . ''; } $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment ); @@ -2266,7 +2267,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, echo "\n"; echo '