diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-06-13 17:21:00 +0000 |
commit | 12de05107e4c8b006bde6ee8916f34eb476d08da (patch) | |
tree | 123ee54ecd1f3f777373b7df54a4604012d43640 /wp-comments-post.php | |
parent | e51c7a9ca4bfdb45fa3ec7334bd33871e78c68b1 (diff) | |
download | wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.gz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.tar.xz wordpress-mu-12de05107e4c8b006bde6ee8916f34eb476d08da.zip |
WP Merge with revision 8075
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1328 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-comments-post.php')
-rw-r--r-- | wp-comments-post.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/wp-comments-post.php b/wp-comments-post.php index f7d7c4f..6ce16fa 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -1,17 +1,25 @@ <?php +/** + * Handles Comment Post to WordPress and prevents duplicate comment posting. + * + * @package @WordPress + */ + if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { header('Allow: POST'); header('HTTP/1.1 405 Method Not Allowed'); header('Content-Type: text/plain'); exit; } -require( dirname(__FILE__) . '/wp-config.php' ); + +/** Sets up the WordPress Environment. */ +require( dirname(__FILE__) . '/wp-load.php' ); nocache_headers(); $comment_post_ID = (int) $_POST['comment_post_ID']; -$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'"); +$status = $wpdb->get_row( $wpdb->prepare("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) ); if ( empty($status->comment_status) ) { do_action('comment_id_not_found', $comment_post_ID); |