summaryrefslogtreecommitdiffstats
path: root/wp-comments-post.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-12 16:21:15 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-10-12 16:21:15 +0000
commit3a4570b0fc8b3d6339bef71d17d7701554e0bbf7 (patch)
tree2a06e5261263c68d8afd95a6328879dc289cb909 /wp-comments-post.php
parentb83c34a7010faee0223f6037025c350da12e05e6 (diff)
downloadwordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.gz
wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.tar.xz
wordpress-mu-3a4570b0fc8b3d6339bef71d17d7701554e0bbf7.zip
Merge with WP 2.3 - testing use only!
Move pluggable functions out of wpmu-functions and into pluggable.php, fixes #439 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1069 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-comments-post.php')
-rw-r--r--wp-comments-post.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/wp-comments-post.php b/wp-comments-post.php
index 9f5d3b8..5637459 100644
--- a/wp-comments-post.php
+++ b/wp-comments-post.php
@@ -1,9 +1,9 @@
<?php
-if ($_SERVER["REQUEST_METHOD"] != "POST") {
- header('Allow: POST');
- header("HTTP/1.1 405 Method Not Allowed");
- header("Content-type: text/plain");
- exit;
+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' );
@@ -19,7 +19,7 @@ if ( empty($status->comment_status) ) {
} elseif ( 'closed' == $status->comment_status ) {
do_action('comment_closed', $comment_post_ID);
wp_die( __('Sorry, comments are closed for this item.') );
-} elseif ( 'draft' == $status->post_status ) {
+} elseif ( in_array($status->post_status, array('draft', 'pending') ) ) {
do_action('comment_on_draft', $comment_post_ID);
exit;
}
@@ -63,11 +63,11 @@ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_emai
$comment_id = wp_new_comment( $commentdata );
$comment = get_comment($comment_id);
-if ( !$user->ID ) :
+if ( !$user->ID ) {
setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
-endif;
+}
$location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
$location = apply_filters('comment_post_redirect', $location, $comment);