Changeset 12401
- Timestamp:
- 12/15/2009 09:45:29 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/comment.php
r12286 r12401 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' : … … 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); -
trunk/wp-admin/includes/dashboard.php
r12311 r12401 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" );
Note: See TracChangeset
for help on using the changeset viewer.