Changeset 23907
- Timestamp:
- 04/04/2013 06:44:38 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ajax-actions.php
r23904 r23907 725 725 726 726 $comment_post_ID = (int) $_POST['comment_post_ID']; 727 $post = get_post( $comment_post_ID ); 728 if ( ! $post ) 729 wp_die( -1 ); 730 727 731 if ( !current_user_can( 'edit_post', $comment_post_ID ) ) 728 732 wp_die( -1 ); 729 733 730 $status = $wpdb->get_var( $wpdb->prepare("SELECT post_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); 731 732 if ( empty($status) ) 734 if ( empty( $post->post_status ) ) 733 735 wp_die( 1 ); 734 elseif ( in_array($ status, array('draft', 'pending', 'trash') ) )736 elseif ( in_array($post->post_status, array('draft', 'pending', 'trash') ) ) 735 737 wp_die( __('ERROR: you are replying to a comment on a draft post.') ); 736 738
Note: See TracChangeset
for help on using the changeset viewer.