Ticket #17909: admin-ajax.diff
| File admin-ajax.diff, 1.6 KB (added by , 15 years ago) |
|---|
-
admin-ajax.php
321 321 case 'delete-comment' : // On success, die with time() instead of 1 322 322 if ( !$comment = get_comment( $id ) ) 323 323 die( (string) time() ); 324 if ( !current_user_can( 'edit_ post', $comment->comment_post_ID ) )324 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) 325 325 die('-1'); 326 326 327 327 check_ajax_referer( "delete-comment_$id" ); … … 457 457 $x->send(); 458 458 } 459 459 460 if ( !current_user_can( 'edit_ post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )460 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) && !current_user_can( 'moderate_comments' ) ) 461 461 die('-1'); 462 462 463 463 $current = wp_get_comment_status( $comment->comment_ID ); … … 612 612 $x = new WP_Ajax_Response(); 613 613 ob_start(); 614 614 foreach ( $wp_list_table->items as $comment ) { 615 if ( !current_user_can( 'edit_comment', $comment->comment_ID ) ) 616 continue; 615 617 get_comment( $comment ); 616 618 $wp_list_table->single_row( $comment ); 617 619 } … … 714 716 715 717 set_current_screen( 'edit-comments' ); 716 718 717 $comment_ post_ID = (int) $_POST['comment_post_ID'];718 if ( ! current_user_can( 'edit_ post', $comment_post_ID) )719 $comment_id = (int) $_POST['comment_ID']; 720 if ( ! current_user_can( 'edit_comment', $comment_id ) ) 719 721 die('-1'); 720 722 721 723 if ( '' == $_POST['content'] ) 722 724 die( __('Error: please type a comment.') ); 723 725 724 $comment_id = (int) $_POST['comment_ID'];725 726 $_POST['comment_status'] = $_POST['status']; 726 727 edit_comment(); 727 728