Changeset 1069 for trunk/wp-comments-post.php
- Timestamp:
- 10/12/07 16:21:15 (1 year ago)
- Files:
-
- trunk/wp-comments-post.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-comments-post.php
r972 r1069 1 1 <?php 2 if ( $_SERVER["REQUEST_METHOD"] != "POST") {3 header('Allow: POST');4 header( "HTTP/1.1 405 Method Not Allowed");5 header( "Content-type: text/plain");6 exit;2 if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { 3 header('Allow: POST'); 4 header('HTTP/1.1 405 Method Not Allowed'); 5 header('Content-Type: text/plain'); 6 exit; 7 7 } 8 8 require( dirname(__FILE__) . '/wp-config.php' ); … … 20 20 do_action('comment_closed', $comment_post_ID); 21 21 wp_die( __('Sorry, comments are closed for this item.') ); 22 } elseif ( 'draft' == $status->post_status) {22 } elseif ( in_array($status->post_status, array('draft', 'pending') ) ) { 23 23 do_action('comment_on_draft', $comment_post_ID); 24 24 exit; … … 64 64 65 65 $comment = get_comment($comment_id); 66 if ( !$user->ID ) :66 if ( !$user->ID ) { 67 67 setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); 68 68 setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); 69 69 setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN); 70 endif; 70 } 71 71 72 72 $location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
