[wp-cvs] wordpress wp-comments-post.php,1.19,1.20
Ryan Boren
rboren at users.sourceforge.net
Mon Nov 15 06:20:31 UTC 2004
Update of /cvsroot/cafelog/wordpress
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13932
Modified Files:
wp-comments-post.php
Log Message:
Refuse comments for post IDs that do not exist.
Index: wp-comments-post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-comments-post.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** wp-comments-post.php 11 Oct 2004 22:07:09 -0000 1.19
--- wp-comments-post.php 15 Nov 2004 06:20:28 -0000 1.20
***************
*** 36,41 ****
$user_ip = $_SERVER['REMOTE_ADDR'];
! if ( 'closed' == $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'") )
die( __('Sorry, comments are closed for this item.') );
if ( get_settings('require_name_email') && ('' == $email || '' == $author) )
--- 36,48 ----
$user_ip = $_SERVER['REMOTE_ADDR'];
! $post_status = $wpdb->get_var("SELECT comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
!
! if ( empty($post_status) ) {
! // Post does not exist. Someone is trolling. Die silently.
! // (Perhaps offer pluggable rebukes? Long delays, etc.)
! die();
! } else if ( 'closed' == $post_status ) {
die( __('Sorry, comments are closed for this item.') );
+ }
if ( get_settings('require_name_email') && ('' == $email || '' == $author) )
More information about the cvs
mailing list