Changeset 1854

Show
Ignore:
Timestamp:
11/15/04 06:20:28 (4 years ago)
Author:
rboren
Message:

Refuse comments for post IDs that do not exist.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-comments-post.php

    r1781 r1854  
    3636$user_ip = $_SERVER['REMOTE_ADDR']; 
    3737 
    38 if ( 'closed' ==  $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'") ) 
     38$post_status = $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); 
     39 
     40if ( empty($post_status) ) { 
     41    // Post does not exist.  Someone is trolling.  Die silently. 
     42    // (Perhaps offer pluggable rebukes? Long delays, etc.) 
     43    die(); 
     44} else if ( 'closed' ==  $post_status ) { 
    3945    die( __('Sorry, comments are closed for this item.') ); 
     46} 
    4047 
    4148if ( get_settings('require_name_email') && ('' == $email || '' == $author) )