Ticket #11432: 11432.2.diff
File 11432.2.diff, 2.7 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/dashboard.php
545 545 546 546 $approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); 547 547 $unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" ); 548 $spam_url = esc_url( "comment.php?action= deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );548 $spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); 549 549 $trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); 550 550 $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" ); 551 551 -
wp-admin/comment.php
137 137 break; 138 138 139 139 case 'deletecomment' : 140 $comment_id = absint( $_REQUEST['c'] );141 check_admin_referer( 'delete-comment_' . $comment_id );142 143 if ( isset( $_REQUEST['noredir'] ) )144 $noredir = true;145 else146 $noredir = false;147 148 if ( !$comment = get_comment( $comment_id ) )149 comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );150 151 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )152 comment_footer_die( __('You are not allowed to edit comments on this post.') );153 154 if ( 'spam' == $_REQUEST['dt'] )155 wp_set_comment_status( $comment->comment_ID, 'spam' );156 else157 wp_delete_comment( $comment->comment_ID );158 159 if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )160 wp_redirect( wp_get_referer() );161 else if ( '' != wp_get_original_referer() && false == $noredir )162 wp_redirect( wp_get_original_referer() );163 else164 wp_redirect( admin_url('edit-comments.php') );165 166 die;167 break;168 169 140 case 'trashcomment' : 170 141 case 'untrashcomment' : 171 142 case 'spamcomment' : … … 190 161 $redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir ); 191 162 192 163 switch ( $action ) { 164 case 'deletecomment' : 165 wp_delete_comment($comment_id); 166 $redir = add_query_arg( array('deleted' => '1'), $redir ); 167 break; 193 168 case 'trashcomment' : 194 169 wp_trash_comment($comment_id); 195 170 $redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );