~katiekitty/+junk/wordpress-byet

« back to all changes in this revision

Viewing changes to wp-comments-post.php

  • Committer: kserver
  • Date: 2010-05-15 01:16:36 UTC
  • Revision ID: kserver@kserver-desktop-20100515011636-mnr1j7t637suptdq
Wordpress 2.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
nocache_headers();
19
19
 
20
 
$comment_post_ID = (int) $_POST['comment_post_ID'];
 
20
$comment_post_ID = isset($_POST['comment_post_ID']) ? (int) $_POST['comment_post_ID'] : 0;
21
21
 
22
22
$status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) );
23
23
 
27
27
} elseif ( !comments_open($comment_post_ID) ) {
28
28
        do_action('comment_closed', $comment_post_ID);
29
29
        wp_die( __('Sorry, comments are closed for this item.') );
30
 
} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
 
30
} elseif ( in_array($status->post_status, array('draft', 'future', 'pending') ) ) {
31
31
        do_action('comment_on_draft', $comment_post_ID);
32
32
        exit;
 
33
} elseif ( 'trash' == $status->post_status ) {
 
34
        do_action('comment_on_trash', $comment_post_ID);
 
35
        exit;
 
36
} elseif ( post_password_required($comment_post_ID) ) {
 
37
        do_action('comment_on_password_protected', $comment_post_ID);
 
38
        exit;
33
39
} else {
34
40
        do_action('pre_comment_on_post', $comment_post_ID);
35
41
}